/* ══════════════════════════════════════════════════════════════════
   VIUCraft Auth — Login + Register (standalone, dark-first)
   Reuses shell.css tokens / buttons / inputs. Split 2-panel: dark
   brand panel (left) + form panel (right). Blue → cyan.
   ══════════════════════════════════════════════════════════════════ */

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--app-bg); }
.auth.register-layout { grid-template-columns: 0.82fr 1.18fr; }

/* offset for public navbar */
.auth { padding-top: 72px; }
@media (max-width: 767.98px) { .auth { padding-top: 60px; } }

/* navbar on auth pages always has dark bg — force dark link styles regardless of theme */
body:has(.auth) .navbar-public.scrolled .navbar-nav .nav-link { color: rgba(255,255,255,0.72); }
body:has(.auth) .navbar-public.scrolled .navbar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
body:has(.auth) .navbar-public.scrolled { background: rgba(7,7,14,0.92); backdrop-filter: saturate(180%) blur(16px); }
body:has(.auth) .navbar-public.scrolled .btn-outline-dark { color: #fff; border-color: rgba(255,255,255,0.2); }
body:has(.auth) .navbar-public.scrolled .btn-outline-dark:hover { background: rgba(255,255,255,0.08); }
body:has(.auth) .navbar-public.scrolled .navbar-brand { color: #fff; }
body:has(.auth) .navbar-public.scrolled .theme-toggle { color: #f1f5f9; border-color: rgba(255,255,255,0.16); }
body:has(.auth) .navbar-public.scrolled .theme-toggle:hover { background: rgba(255,255,255,0.08); }
body:has(.auth) .navbar-public.scrolled .btn-primary { background: var(--primary-blue, #2563eb); color: #fff; box-shadow: 0 4px 14px 0 rgba(37,99,235,0.4); }
body:has(.auth) .navbar-public.scrolled .btn-primary:hover { background: #1d4ed8; }

/* ───── brand panel ───── */
.auth-brand { position: relative; overflow: hidden; background: var(--vc-ink, #07070e); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(3.5rem, 6vw, 5rem); isolation: isolate; }
[data-theme="light"] .auth-brand { background: #07070e; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 30px 30px; -webkit-mask-image: radial-gradient(ellipse 90% 80% at 40% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 90% 80% at 40% 30%, #000 30%, transparent 75%); z-index: -1; }
.auth-brand::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(closest-side, rgba(37,99,235,0.35), transparent 70%) -120px -80px/460px 460px no-repeat, radial-gradient(closest-side, rgba(6,182,212,0.28), transparent 70%) 80% 90%/520px 520px no-repeat; filter: blur(8px); }
.auth-brand-mid { max-width: 440px; position: relative; z-index: 1; }
.auth-brand-logo { display: flex; align-items: center; gap: 0.7rem; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.auth-brand-logo .lg { width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.15rem; border-radius: var(--r-md, 8px); background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #06b6d4 100%); color: #fff; box-shadow: 0 8px 20px -6px rgba(14,165,233,0.6); }
.auth-brand h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 1rem; color: #f8fafc; text-wrap: balance; }
.auth-brand h1 .grad { background: linear-gradient(104deg, #bae6fd 0%, #60a5fa 40%, #22d3ee 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.auth-brand .lede { color: rgba(226,232,240,0.66); font-size: 1rem; line-height: 1.6; margin: 1rem 0 0; max-width: 380px; }

/* rotating terminal demo */
.auth-demo { margin-top: 1.6rem; background: rgba(11,11,20,0.7); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--r-lg, 12px); overflow: hidden; backdrop-filter: blur(8px); box-shadow: var(--shadow-lg); max-width: 440px; }
.auth-demo-bar { display: flex; align-items: center; gap: 6px; padding: 0.6rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.auth-demo-bar .d { width: 10px; height: 10px; border-radius: 50%; }
.auth-demo-bar .d1 { background: #ff5f56; } .auth-demo-bar .d2 { background: #ffbd2e; } .auth-demo-bar .d3 { background: #27c93f; }
.auth-demo-bar .lbl { margin-left: 8px; font-family: var(--mono); font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.auth-demo-body { padding: 1rem 1.1rem; font-family: var(--mono); font-size: 0.82rem; line-height: 1.9; color: #cdd6f4; min-height: 92px; }
.auth-demo-body .c-cm { color: #6b7191; }
.auth-demo-body .c-m { color: #7fe0a8; }
.auth-demo-body .c-u { color: #9fd0ff; }
.auth-demo-body .c-p { color: #fbd38d; }
.auth-demo-line { opacity: 0; transition: opacity 0.4s; }
.auth-demo-line.show { opacity: 1; }

.auth-trust { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.auth-trust .t { display: flex; align-items: center; gap: 0.7rem; font-size: 0.875rem; color: rgba(226,232,240,0.82); }
.auth-trust .t i { color: #38bdf8; font-size: 0.95rem; width: 18px; text-align: center; }

.remember-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }

.agree-terms-wrapper { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0.5rem 0 1.25rem; }
.agree-terms-wrapper label { font-size: 0.875rem; color: var(--text-muted, #64748b); line-height: 1.5; cursor: pointer; }
.agree-terms-wrapper a { color: var(--accent-strong, #2563eb); font-weight: 600; }
[data-theme="dark"] .agree-terms-wrapper label { color: #94a3b8; }
[data-theme="dark"] .agree-terms-wrapper a { color: #7dd3fc; }
.remember-row .forgot { font-size: 0.875rem; font-weight: 600; color: var(--accent-strong, #2563eb); cursor: pointer; text-decoration: none; }
.remember-row .forgot:hover { text-decoration: underline; }
[data-theme="dark"] .remember-row .forgot { color: #7dd3fc; }

/* ───── form panel ───── */
.auth-form-wrap { display: flex; flex-direction: column; justify-content: center; padding: 2.6rem; background: var(--surface); color: #334155; }
[data-theme="dark"] .auth-form-wrap { color: #e2e8f0; }
.auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form h2 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 0.3rem; color: #1e293b; }
[data-theme="dark"] .auth-form h2 { color: #f1f5f9; }
.auth-form .sub { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 1.8rem; }
.oauth-row { display: grid; gap: 0.65rem; margin-bottom: 1.4rem; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; height: 46px; border-radius: var(--r-md); border: 1px solid var(--edge-strong); background: var(--surface-2); color: var(--text); font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); text-decoration: none; }
.oauth-btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.3); color: var(--text); }
.oauth-btn:focus,
.oauth-btn:focus-visible,
.oauth-btn:active { outline: none !important; box-shadow: none !important; }
.oauth-btn .g-icon { color: #ea4335; }
.auth-divider { display: flex; align-items: center; gap: 0.9rem; margin: 1.4rem 0; color: var(--text-faint); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.auth-form .form-control,
.auth-form .input {
  width: 100%; height: 42px; padding: 0 0.85rem; border-radius: var(--r-md);
  border: 1px solid var(--edge); background: var(--surface-2); color: var(--text);
  font-size: 0.9rem; font-family: var(--ui); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.auth-form .form-control:focus,
.auth-form .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.auth-form .form-check-input { width: 16px; height: 16px; accent-color: var(--accent); }

.field { margin-bottom: 1rem; }
.field .label { display: flex; align-items: center; }
.field .label .forgot { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; color: var(--accent-strong); cursor: pointer; }
.field .label .forgot:hover { text-decoration: underline; }
.input-wrap { position: relative; }
.input-wrap .eye { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: var(--text-faint); cursor: pointer; padding: 0.3rem; }
.input-wrap .eye:hover { color: var(--text-main, #1e293b); }
.field-err { font-size: 0.78rem; color: #f87171; margin-top: 0.35rem; display: none; align-items: center; gap: 0.35rem; }
.field.invalid .input, .field.invalid .form-control { border-color: #f87171; }
.field.invalid .field-err { display: flex; }
.field.valid .input, .field.valid .form-control { border-color: rgba(16,185,129,0.5); }
.auth-alert { display: flex; gap: 0.6rem; padding: 0.75rem 0.9rem; border-radius: var(--r-md); font-size: 0.85rem; margin-bottom: 1.2rem; align-items: flex-start; }
.auth-alert.warn { background: var(--warn-soft); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.auth-alert-error { display: flex; gap: 0.5rem; padding: 0.75rem 0.9rem; border-radius: var(--r-md); font-size: 0.85rem; margin-bottom: 1.2rem; align-items: center; background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.auth-alert-error i { flex-shrink: 0; }
ul.form-errors { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.form-errors li { display: flex; gap: 0.5rem; padding: 0.6rem 0.8rem; border-radius: var(--r-md); font-size: 0.82rem; align-items: center; background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.25); margin-bottom: 0.4rem; }
.auth-alert .resend { display: block; margin-top: 0.5rem; }
.remember { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; color: #475569; cursor: pointer; margin-bottom: 0; }
[data-theme="dark"] .remember { color: #cbd5e1; }
.remember input { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--edge-strong); border-radius: 4px; background: var(--surface-2); cursor: pointer; position: relative; flex-shrink: 0; transition: background 0.15s, border-color 0.15s; }
.remember input:checked { background: var(--accent); border-color: var(--accent); }
.remember input:checked::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 0.6rem; color: #fff; position: absolute; inset: 0; display: grid; place-items: center; }
.remember input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-foot { text-align: center; margin-top: 1.5rem; font-size: 0.88rem; color: var(--text-muted); }
.auth-foot a { color: var(--accent-strong); font-weight: 600; cursor: pointer; }
.auth-foot a:hover { text-decoration: underline; }
.terms-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin: 0.2rem 0 1.2rem; }
.terms-note a { color: var(--accent-strong); cursor: pointer; }

/* password strength */
.pw-meter { margin-top: 0.6rem; }
.pw-bar { height: 5px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; margin-bottom: 0.4rem; }
.pw-fill { height: 100%; width: 100%; border-radius: var(--r-full); transform: scaleX(0); transform-origin: left; transition: transform 0.3s, background 0.3s; }
.pw-fill.s1 { transform: scaleX(0.25); background: #ef4444; } .pw-fill.s2 { transform: scaleX(0.5); background: #f59e0b; }
.pw-fill.s3 { transform: scaleX(0.75); background: #10b981; } .pw-fill.s4 { transform: scaleX(1); background: #059669; }
.pw-label { font-size: 0.76rem; font-weight: 600; }
.pw-crit { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin-top: 0.4rem; font-size: 0.72rem; color: var(--text-faint); }
.pw-crit span.met { color: #34d399; }
.pw-crit span.met::before { content: "✓ "; }

/* benefits (register) */
.auth-benefits { display: flex; flex-direction: column; gap: 0.9rem; max-width: 400px; margin-top: 0.4rem; }
.auth-benefit { display: flex; gap: 0.8rem; align-items: flex-start; }
.auth-benefit .bi { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #38bdf8; }
.auth-benefit h4 { margin: 0 0 0.15rem; font-size: 0.92rem; color: #fff; }
.auth-benefit p { margin: 0; font-size: 0.8rem; color: rgba(226,232,240,0.6); line-height: 1.5; }

@media (max-width: 880px) {
  .auth, .auth.register-layout { grid-template-columns: 1fr; }
  .auth-brand { padding: 1.6rem; }
  .auth-brand-mid, .auth-demo, .auth-trust, .auth-benefits { display: none; }
  .auth-brand { flex-direction: row; align-items: center; gap: 0.8rem; min-height: auto; }
  .auth-brand .mobile-tag { font-size: 0.82rem; color: rgba(226,232,240,0.7); }
  .auth-form-wrap { padding: 2rem 1.4rem; }
}
@media (min-width: 881px) { .auth-brand .mobile-tag { display: none; } }
