/* ================================================================
   public/css/auth.css
   Stiluri pentru paginile de autentificare (login, reset etc.)
   Design system: Continental Print — Sapere Plus
================================================================ */

/* ── Design tokens: Light ────────────────────────────────────── */
:root {
  --bg:        #f5f2eb;
  --surface:   #ffffff;
  --surface-2: #edeae2;
  --border:    #ddd8cc;
  --ink:       #1c1712;
  --graphite:  #4a4540;
  --sienna:    #8c3a1c;
  --sienna-l:  #b04a25;
  --amber:     #c47628;
  --red:       #7d2323;
  --radius:    5px;
  --serif:     'Cormorant Garamond', Georgia, serif;
  --cond:      'Barlow Condensed', sans-serif;
  --ease:      0.22s ease;
}

/* ── Design tokens: Dark ─────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #0c0a07;
  --surface:   #161410;
  --surface-2: #1c1916;
  --border:    #2e2a24;
  --ink:       #ece8df;
  --graphite:  #b0a898;
  --sienna:    #d46240;
  --sienna-l:  #e07050;
  --amber:     #d68f49;
}

/* ── Reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(circle at 18% 18%, rgba(192, 120, 48, 0.11), transparent 26rem),
    linear-gradient(135deg, var(--bg), var(--surface-2));
  color: var(--ink);
  font-family: var(--serif);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--ease), color var(--ease);
}

/* ── Floating controls (top-right) ───────────────────────────── */
.login-controls {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 100;
}

/* Lang toggle */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.lang-btn {
  padding: 0.35rem 0.65rem;
  background: transparent;
  border: none;
  color: var(--amber);
  font-family: var(--cond);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--ease);
  line-height: 1;
}
.lang-btn + .lang-btn {
  border-left: 1px solid var(--border);
}
.lang-btn:hover {
  color: var(--sienna);
}
.lang-btn.active {
  background: var(--sienna);
  color: #fff;
}
[data-theme="dark"] .lang-btn.active {
  background: var(--amber);
  color: var(--bg);
  font-weight: 600;
}

/* Theme button */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--graphite);
  transition: all var(--ease);
}
.theme-btn:hover {
  border-color: var(--sienna);
  color: var(--sienna);
}

/* ── Layout: split left/right ────────────────────────────────── */
.login-wrap {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

/* ── Left panel: editorial visual ───────────────────────────── */
.login-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem;
  background:
    linear-gradient(180deg, rgba(28, 23, 18, 0.08), rgba(28, 23, 18, 0)),
    var(--surface-2);
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Newspaper line texture */
.login-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 27px,
    var(--border) 27px,
    var(--border) 28px
  );
  opacity: 0.3;
  pointer-events: none;
}

.visual-meta {
  position: absolute;
  top: 2rem;
  left: 4rem;
  font-family: var(--cond);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
}

.visual-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.visual-rule {
  width: 40px;
  height: 2px;
  background: var(--sienna);
  margin-bottom: 2rem;
}

.typewriter-label {
  font-family: var(--cond);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sienna);
  margin-bottom: 1.25rem;
}

.typewriter-text {
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink);
  min-height: 3.9em;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--sienna);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.visual-footnote {
  margin-top: 2rem;
  font-size: 1.2rem;
  color: var(--amber);
  line-height: 1.65;
  max-width: 360px;
  font-weight: 600;
}

.visual-auth-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 2rem;
}

.visual-auth-stats span {
  border: 1px solid color-mix(in srgb, var(--sienna) 34%, var(--border));
  border-radius: 999px;
  padding: 0.32rem 0.65rem;
  color: var(--graphite);
  font-family: var(--cond);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Right panel: form ───────────────────────────────────────── */
.login-form-area {
  flex: 0 0 550px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 4rem;
}

.form-inner { width: 100%; }

.auth-card {
  position: relative;
  padding: 2.25rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(28, 23, 18, 0.12);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  border-radius: 5px;
  pointer-events: none;
}

.auth-card > * {
  position: relative;
}

.form-logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.form-logo-mark {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--sienna);
  line-height: 1;
}
.form-logo-label {
  font-family: var(--cond);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

.form-title {
  font-size: clamp(1.65rem, 2.7vw, 2.15rem);
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.form-sub {
  font-family: var(--cond);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 2.5rem;
  font-weight: 600;

}
.form-divider {
  width: 24px;
  height: 1px;
  background: var(--sienna);
  margin-bottom: 2.5rem;
}

.admin-login-copy,
.auth-note {
  color: var(--amber);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 600;
}

.admin-login-copy {
  margin: -1.4rem 0 1.8rem;
}

/* ── Form fields ─────────────────────────────────────────────── */
.field { margin-bottom: 1.4rem; }

.field label {
  display: block;
  font-family: var(--cond);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field input::placeholder { color: var(--graphite); opacity: 0.5; font-weight: 600; }
.field input:focus {
  border-color: var(--sienna);
  box-shadow: 0 0 0 3px rgba(140, 58, 28, 0.1);
}
[data-theme="dark"] .field input:focus {
  box-shadow: 0 0 0 3px rgba(212, 98, 64, 0.12);
}

/* ── Submit button ───────────────────────────────────────────── */
.btn-login {
  width: 100%;
  padding: 0.9rem;
  margin-top: 0.5rem;
  background: var(--sienna);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--cond);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-login:hover {
  background: var(--sienna-l);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(140, 58, 28, 0.25);
}
.btn-login:active { transform: none; }

.success-msg {
  background: rgba(90, 135, 96, 0.1);
  border: 1px solid rgba(90, 135, 96, 0.32);
  border-left: 3px solid #5a8760;
  color: #426b48;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--cond);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.75rem;
}

/* ── Error message ───────────────────────────────────────────── */
.error-msg {
  background: rgba(125, 35, 35, 0.07);
  border: 1px solid rgba(125, 35, 35, 0.3);
  border-left: 3px solid var(--red);
  color: var(--red);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--cond);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.75rem;
}
[data-theme="dark"] .error-msg {
  background: rgba(180, 50, 50, 0.12);
  border-color: rgba(180, 50, 50, 0.3);
  color: #e07070;
}

/* ── Form footer ─────────────────────────────────────────────── */
.form-footer {
  margin-top: 2rem;
  text-align: center;
}

.auth-note {
  margin-top: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.public-login-title {
  max-width: 540px;
  color: var(--ink);
  font-size: clamp(2.1rem, 4.5vw, 4.4rem);
  font-weight: 300;
  line-height: 0.98;
}

.auth-callback-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-callback-card {
  width: min(100%, 28rem);
  padding: 2.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(28, 23, 18, 0.12);
}

.auth-callback-message {
  color: var(--graphite);
  font-size: 0.95rem;
  line-height: 1.6;
}

.form-footer a {
  font-family: var(--cond);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  text-decoration: none;
  transition: color var(--ease);
  font-weight: 600;
}
.form-footer a:hover { color: var(--sienna); }

/* ── Login Visual Animation ──────────────────────────────────── */
.login-visual-animation {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.lva-svg {
  width: min(600px, 85%);
  height: auto;
  overflow: visible;
  margin-bottom:2rem;
}

/* Rotație lentă cerc exterior */
.lva-circle-outer {
  transform-origin: 260px 200px;
  animation: lva-rotate-cw 28s linear infinite;
}

/* Rotație inversă cerc mediu */
.lva-circle-mid {
  transform-origin: 260px 200px;
  animation: lva-rotate-ccw 18s linear infinite;
}

/* Puls cerc interior */
.lva-circle-inner {
  transform-origin: 260px 200px;
  animation: lva-pulse 4s ease-in-out infinite;
}

/* Ring pulsant în jurul dot-ului central */
.lva-dot-ring {
  animation: lva-ring-expand 3s ease-out infinite;
  transform-origin: 260px 200px;
}

/* Rotație text arc */
.lva-arc-text {
  animation: lva-rotate-cw 40s linear infinite;
  transform-origin: 260px 200px;
}

/* Linie orizontală — apare cu delay */
.lva-rule {
  animation: lva-rule-draw 1.8s ease forwards;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

/* Titlu — fade-in la boot */
.lva-title,
.lva-subtitle {
  animation: lva-fadein 1.4s ease forwards;
  opacity: 0;
}
.lva-subtitle { animation-delay: 0.3s; }

/* Ticks — fade-in scalonat */
.lva-ticks line {
  animation: lva-fadein 1s ease forwards;
  opacity: 0;
}
.lva-ticks line:nth-child(1) { animation-delay: 0.1s; }
.lva-ticks line:nth-child(2) { animation-delay: 0.2s; }
.lva-ticks line:nth-child(3) { animation-delay: 0.3s; }
.lva-ticks line:nth-child(4) { animation-delay: 0.4s; }
.lva-ticks line:nth-child(5) { animation-delay: 0.5s; }
.lva-ticks line:nth-child(6) { animation-delay: 0.6s; }
.lva-ticks line:nth-child(7) { animation-delay: 0.7s; }
.lva-ticks line:nth-child(8) { animation-delay: 0.8s; }

/* ── Keyframes ── */
@keyframes lva-rotate-cw {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}
@keyframes lva-rotate-ccw {
  from { transform: rotate(0deg);    }
  to   { transform: rotate(-360deg); }
}
@keyframes lva-pulse {
  0%, 100% { opacity: 0.28; transform: scale(1);    }
  50%       { opacity: 0.45; transform: scale(1.04); }
}
@keyframes lva-ring-expand {
  0%   { r: 4.5;  opacity: 0.85; }
  70%  { r: 18;   opacity: 0;    }
  100% { r: 18;   opacity: 0;    }
}
@keyframes lva-rule-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes lva-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .login-wrap { flex-direction: column; }

  .login-visual {
    flex: none;
    padding: 3rem 2rem 2.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: auto;
    justify-content: flex-start;
  }
  .visual-meta       { left: 2rem; top: 1.25rem; }
  .typewriter-text   { font-size: 2rem; min-height: auto; }
  .login-form-area   { flex: none; padding: 3rem 2rem; }
  .login-controls    { top: 1rem; right: 1.25rem; }
  .auth-card          { padding: 1.6rem; }
  .public-login-title { font-size: 2.25rem; }

  .lva-svg {display: none;}
}

        .callback-container {
            text-align: center;
            padding: 2rem;
            max-width: 480px;
            width: 90%;
            background: rgba(255,255,255,0.95);
            border-radius: 32px;
            box-shadow: 0 25px 45px -12px rgba(0,0,0,0.2);
            backdrop-filter: blur(2px);
            transition: all 0.2s ease;
        }
        .logo {
            font-size: 2.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, #1e3c72, #2a5298);
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
            margin-bottom: 1rem;
        }
        .spinner {
            width: 48px;
            height: 48px;
            border: 4px solid #e2e8f0;
            border-top: 4px solid #2a5298;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 1.5rem auto;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .message {
            font-size: 1.1rem;
            color: #1e293b;
            margin: 1rem 0;
        }
        .submessage {
            font-size: 0.85rem;
            color: #64748b;
            margin-top: 1rem;
        }
        .footer {
            margin-top: 2rem;
            font-size: 0.75rem;
            color: #94a3b8;
        }
        @media (prefers-color-scheme: dark) {
            body { background: linear-gradient(135deg, #0f172a, #1e293b); }
            .callback-container { background: rgba(30,41,59,0.95); box-shadow: 0 25px 45px -12px rgba(0,0,0,0.4); }
            .message { color: #e2e8f0; }
            .submessage { color: #94a3b8; }
            .spinner { border-color: #334155; border-top-color: #60a5fa; }
        }