/* ════════════════════════════════════════════════════════════
   auth.css — Login / Registrazione
   Dark split-screen con brand panel animato a sinistra
   ════════════════════════════════════════════════════════════ */

#auth-page {
  background: var(--night);
  position: relative; overflow: hidden;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%; min-height: 100vh;
}

/* ── Brand panel ─────────────────────────────────────────── */
.auth-brand {
  background: var(--night-2);
  border-right: 1px solid var(--night-3);
  display: flex; flex-direction: column; justify-content: center;
  padding: 4rem 3.5rem;
  position: relative; overflow: hidden;
}

/* Animated mesh background */
.auth-brand::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 30%, rgba(59,124,244,.15) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 75% 75%, rgba(232,53,43,.10) 0%, transparent 60%);
  animation: none;
}

/* Decorative line */
.auth-brand::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--blue-glow) 40%, var(--red-glow) 70%, transparent);
}

.brand-logo {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 3.5rem;
}
.brand-logo-icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--blue), var(--red));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px var(--blue-glow), 0 4px 24px var(--red-glow);
  flex-shrink: 0;
}
.brand-logo-icon svg { color: #fff; }
.brand-logo span {
  font-family: var(--display);
  font-size: 1.9rem; letter-spacing: .08em; color: var(--white);
}

.brand-headline {
  font-family: var(--display);
  font-size: 4rem; letter-spacing: .05em; line-height: 1.05;
  color: var(--white); margin-bottom: 1.4rem;
}
.brand-headline em {
  font-style: italic; font-family: var(--serif);
  color: var(--blue-text); font-size: 3.2rem;
  display: block; letter-spacing: 0;
}

.brand-sub {
  font-size: .9rem; color: var(--ink-dim); line-height: 1.75;
  max-width: 340px; font-weight: 300; margin-bottom: 2.5rem;
}

.brand-features { display: flex; flex-direction: column; gap: .8rem; }
.feat {
  display: flex; align-items: center; gap: .85rem;
  color: var(--ink); font-size: .85rem; font-weight: 300;
}
.feat-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  position: relative;
}
.feat-dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  opacity: .4;
}
.feat-dot.b { background: var(--blue-bright); }
.feat-dot.b::after { background: var(--blue-glow); }
.feat-dot.r { background: var(--red-bright); }
.feat-dot.r::after { background: var(--red-glow); }
.feat-dot.g { background: var(--gold); }
.feat-dot.g::after { background: var(--gold-dim); }

/* Decorative book spines */
.brand-spines {
  position: absolute; bottom: 2.5rem; right: 2.5rem;
  display: flex; gap: 5px; align-items: flex-end;
}
.brand-spine {
  width: 14px; border-radius: 2px 2px 0 0;
  opacity: .25; transition: opacity .3s;
}
.auth-brand:hover .brand-spine { opacity: .45; }
.brand-spine:nth-child(1) { height: 80px;  background: var(--blue); }
.brand-spine:nth-child(2) { height: 110px; background: var(--red); }
.brand-spine:nth-child(3) { height: 65px;  background: var(--gold); }
.brand-spine:nth-child(4) { height: 90px;  background: var(--blue-bright); }
.brand-spine:nth-child(5) { height: 75px;  background: var(--red-bright); }
.brand-spine:nth-child(6) { height: 100px; background: var(--blue); opacity:.15; }

/* ── Form panel ──────────────────────────────────────────── */
.auth-form-panel {
  background: var(--night);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2.5rem;
}
.auth-form-inner { width: 100%; max-width: 400px; }

/* ── Tabs ────────────────────────────────────────────────── */
.auth-tabs {
  display: flex; gap: .25rem;
  background: var(--night-2);
  border: 1px solid var(--night-3);
  border-radius: var(--radius);
  padding: .25rem;
  margin-bottom: 2rem;
}
.auth-tab {
  flex: 1; padding: .65rem; text-align: center;
  cursor: pointer; font-weight: 600; font-size: .85rem;
  color: var(--ink-dim); border-radius: 7px;
  transition: all var(--tr);
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.active {
  background: var(--night-4);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.auth-panel { display: none; }
.auth-panel.active { display: block; animation: fadeIn .22s var(--tr); }

.auth-panel h2 {
  font-family: var(--display);
  font-size: 2.2rem; letter-spacing: .06em;
  color: var(--white); margin-bottom: .3rem;
}
.auth-panel p.sub { color: var(--ink-dim); font-size: .85rem; margin-bottom: 1.6rem; font-weight: 300; }

/* ── Form fields ─────────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-field label {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-dim);
}
.form-field input {
  background: var(--night-2);
  border: 1px solid var(--night-4);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font-family: var(--sans); font-size: .9rem;
  color: var(--ink-bright); outline: none; width: 100%;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.form-field input::placeholder { color: var(--ink-dim); }
.form-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim), var(--glow-blue);
}
.input-hint { font-size: .72rem; color: var(--ink-dim); margin-top: .15rem; font-weight: 300; }

/* ── Feedback ────────────────────────────────────────────── */
.auth-error {
  background: var(--red-dim);
  border: 1px solid rgba(232,53,43,.25);
  color: var(--red-text);
  border-radius: var(--radius); padding: .7rem 1rem;
  font-size: .85rem; margin-bottom: 1rem; display: none;
}
.auth-error.show { display: block; animation: fadeIn .2s; }
.auth-success {
  background: rgba(52,211,153,.08);
  border: 1px solid rgba(52,211,153,.25);
  color: #6ee7b7;
  border-radius: var(--radius); padding: .7rem 1rem;
  font-size: .85rem; margin-bottom: 1rem; display: none;
}
.auth-success.show { display: block; animation: fadeIn .2s; }

/* ── Auth button ─────────────────────────────────────────── */
.btn-auth {
  width: 100%;
  background: linear-gradient(135deg, var(--blue) 0%, #1a5de0 100%);
  color: #fff; border: none;
  border-radius: var(--radius);
  padding: .9rem;
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  cursor: pointer; letter-spacing: .02em;
  transition: all var(--tr);
  margin-top: .2rem;
  position: relative; overflow: hidden;
}
.btn-auth::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent);
}
.btn-auth:hover {
  box-shadow: 0 6px 24px var(--blue-glow);
  transform: translateY(-1px);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-auth.red {
  background: linear-gradient(135deg, var(--red) 0%, #c02015 100%);
}
.btn-auth.red:hover { box-shadow: 0 6px 24px var(--red-glow); }

/* ── Demo box ────────────────────────────────────────────── */
.auth-demo {
  margin-top: 1.4rem;
  background: var(--night-2); border: 1px solid var(--night-3);
  border-radius: var(--radius); padding: .85rem 1rem;
  font-size: .78rem; color: var(--ink-dim);
}
.auth-demo strong { display: block; margin-bottom: .3rem; color: var(--blue-text); font-size: .8rem; }
.auth-demo code { color: var(--ink); background: var(--night-3); padding: .1rem .4rem; border-radius: 4px; font-size: .8rem; }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.2rem 0; color: var(--ink-dim); font-size: .78rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--night-3);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-panel {
    padding: 2rem 1.5rem;
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 3rem;
  }
  .auth-form-inner { max-width: 100%; }
}