/* =========================================
   AUTH UI (Login/Register/Forgot)
   Modern, consistent with main.css
========================================= */

:root{
  /* Uses main.css tokens if loaded; provides fallback */
  --bg: var(--bg, #f3f4f6);
  --card: var(--card, #ffffff);
  --ink: var(--ink, #111827);
  --muted: var(--muted, #6b7280);
  --accent: var(--accent, #2563eb);
  --line: var(--line, #e5e7eb);

  --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 18px 55px rgba(15, 23, 42, 0.12);

  --radius-lg: 16px;
  --radius-md: 12px;
}

/* Centering wrapper */
.auth-wrap{
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 22px 14px 34px;
}

/* Auth card */
.auth-card{
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-soft);
}

/* Titles */
.auth-title{
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ink);
}

.auth-subtitle{
  margin: 0 0 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

/* Labels & Inputs */
.auth-label{
  display:block;
  margin: 12px 0 6px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #0f172a;
}

.auth-input{
  width:100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:#fff;
  color: var(--ink);
  outline:none;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.auth-input::placeholder{
  color: rgba(17,24,39,0.42);
}

.auth-input:focus{
  border-color: rgba(37,99,235,0.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.14);
}

/* Primary button */
.btn-primary{
  width:100%;
  margin-top: 14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color:#fff;
  font-weight: 900;
  letter-spacing: 0.2px;
  cursor:pointer;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
  transition: transform 0.05s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover{
  filter: brightness(1.02);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.25);
}

.btn-primary:active{
  transform: translateY(1px);
}

/* Meta links */
.auth-meta{
  text-align:center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-link{
  color: var(--ink);
  text-decoration: underline;
  font-weight: 800;
}

/* Alerts (existing Thymeleaf conditions unchanged) */
.auth-alert{
  padding: 11px 12px;
  border-radius: 12px;
  margin: 10px 0 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.auth-alert.error{
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FCA5A5;
}

.auth-alert.success{
  background: #DCFCE7;
  color: #166534;
  border-color: #86EFAC;
}

/* Legacy .alert block support (you had these in old login.css) */
.alert{
  display:flex;
  align-items:flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  animation: alert-fade-in 0.25s ease-out;
  border: 1px solid var(--line);
}

.alert-error{
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #991B1B;
}

.alert-icon{
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  background: #FCA5A5;
  color: #7F1D1D;
  margin-top: 2px;
}

.alert-content{ display:flex; flex-direction:column; gap: 2px; }
.alert-title{ font-weight: 900; }
.alert-text{ font-size: 13px; opacity: 0.92; }

@keyframes alert-fade-in{
  from{ opacity: 0; transform: translateY(-4px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 520px){
  .auth-wrap{
    min-height: calc(100vh - 72px);
    padding: 16px 12px 26px;
  }

  .auth-card{
    padding: 18px 14px 14px;
    border-radius: 14px;
  }

  .auth-title{
    font-size: 1.35rem;
  }

  .btn-primary{
    padding: 12px 12px;
  }
}
