/* ============================================
   AUTH PAGES — Liquid Glass Design System
   Shared across: login, OTP, forgot, reset
   Dark Royal Blue · Blue · Silver
   ============================================ */

:root {
  /* Core palette (mirrors resiapp_design_system.css) */
  --da-royal: #0F2A52;
  --da-royal-light: #1A3D6E;
  --da-royal-rgb: 15, 42, 82;
  --da-gold: #3b82f6;
  --da-gold-light: #60a5fa;
  --da-gold-rgb: 59, 130, 246;
  --da-silver: #5C6168;
  --da-silver-light: #7A7F85;
  --da-silver-rgb: 92, 97, 104;

  /* Typography */
  --font-heading: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fw-normal:    400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;
  --fw-black:     900;
  --fs-xs:   0.75rem;
  --fs-sm:   0.8rem;
  --fs-base: 0.875rem;
  --fs-md:   0.9rem;
  --fs-lg:   0.95rem;
  --fs-xl:   1rem;
  --fs-2xl:  1.125rem;
  --fs-3xl:  1.25rem;

  /* Status colors */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Foundation mirror (resiapp_design_system.css) */
  --font-display: 'Sora', var(--font-heading);
  --color-text-faint: rgba(255, 255, 255, 0.55);
  --glass-blur: 24px;
  --glass-saturate: 160%;
}

/* ============================================
   RESET
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

/* ============================================
   BODY — Dark Background + Orbs
   ============================================ */

body {
  font-family: var(--font-heading);
  color: rgba(255, 255, 255, 0.95);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #08080d;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background orbs — matching app_layout.css (blue center + silver corners) */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Blue center orb */
body::before {
  width: 700px;
  height: 420px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
      rgba(0, 35, 160, 0.35) 0%,
      rgba(0, 25, 120, 0.20) 35%,
      rgba(0, 18, 80, 0.08) 60%,
      transparent 80%);
  filter: blur(90px);
}

/* Silver corner — bottom-right */
body::after {
  width: 400px;
  height: 400px;
  bottom: -80px;
  right: -80px;
  background: radial-gradient(circle at center,
      rgba(160, 165, 175, 0.30) 0%,
      rgba(140, 145, 155, 0.12) 40%,
      transparent 70%);
  filter: blur(70px);
}

/* ============================================
   AUTH SHELL — Glass Card Container
   ============================================ */

.auth-shell {
  width: 100%;
  max-width: 1050px;
  min-height: 600px;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-color: rgba(255, 255, 255, 0.18);
  border-left-color: rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

/* Top-edge specular line (Apple glass signature) */
.auth-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25) 25%,
      rgba(255, 255, 255, 0.40) 50%,
      rgba(255, 255, 255, 0.25) 75%,
      transparent);
  pointer-events: none;
  z-index: 5;
}

/* ============================================
   LEFT SIDE — Brand Cover (Royal Blue)
   ============================================ */

.auth-cover {
  flex: 1.1;
  position: relative;
  padding: 60px 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg,
      rgba(var(--da-royal-rgb), 0.95) 0%,
      rgba(var(--da-royal-rgb), 0.80) 50%,
      rgba(15, 30, 60, 0.90) 100%);
  overflow: hidden;
}

/* Ambient light overlay */
.auth-cover::before {
  content: '';
  position: absolute;
  inset: -150px;
  background:
    radial-gradient(circle at 30% 40%, rgba(var(--da-gold-rgb), 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(var(--da-silver-rgb), 0.10) 0%, transparent 50%);
  filter: blur(40px);
  opacity: 0.9;
  pointer-events: none;
}

/* Grid pattern overlay */
.auth-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M40 0H0V40" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="1"/></pattern></defs><rect width="120" height="120" fill="url(%23grid)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.cover-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.cover-logo {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: var(--fw-extrabold); /* Sora has no 900 */
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.75) 60%, rgba(var(--da-silver-rgb), 0.9) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cover-subtitle {
  margin-top: 20px;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

/* ============================================
   RIGHT SIDE — Form (Dark Glass Surface)
   ============================================ */

.auth-form {
  flex: 0.9;
  background: rgba(255, 255, 255, 0.03);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* Subtle inner glow from top-left */
.auth-form::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 20% 5%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.auth-form > * {
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* ============================================
   BACK BUTTON
   ============================================ */

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-button:active {
  transform: translateY(0);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  font-size: var(--fs-lg);
  font-family: inherit;
  font-weight: var(--fw-medium);
  line-height: 1.4;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  color: var(--color-gray-50);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.form-input::placeholder {
  color: var(--color-gray-500);
  font-weight: var(--fw-normal);
}

.form-input:focus {
  outline: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(var(--da-gold-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--da-gold-rgb), 0.15), 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Autofill override for dark inputs */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: rgba(255, 255, 255, 0.95);
  -webkit-box-shadow: 0 0 0 1000px rgba(15, 42, 82, 0.5) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ============================================
   FORGOT PASSWORD LINK
   ============================================ */

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 12px;
}

.forgot-link {
  color: rgba(var(--da-gold-rgb), 0.8);
  text-decoration: none;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  transition: all 0.2s ease;
}

.forgot-link:hover {
  color: var(--da-gold-light);
  text-decoration: underline;
}

/* ============================================
   SUBMIT BUTTON — Royal → Silver Gradient
   ============================================ */

.submit-button {
  width: 100%;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--da-royal) 0%, var(--da-silver) 100%);
  color: #fff;
  border: 1.5px solid rgba(var(--da-gold-rgb), 0.3);
  border-radius: 12px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(var(--da-gold-rgb), 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.submit-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.submit-button:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(var(--da-royal-rgb), 0.95) 0%, rgba(var(--da-royal-rgb), 0.85) 100%);
  box-shadow: 0 8px 25px rgba(var(--da-gold-rgb), 0.35),
              0 0 40px rgba(var(--da-silver-rgb), 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.submit-button:hover::before {
  opacity: 1;
}

.submit-button:active {
  transform: translateY(-1px);
}

/* ============================================
   SIGNUP LINK
   ============================================ */

.signup-link {
  text-align: center;
  margin-top: 24px;
  font-size: var(--fs-base);
  color: rgba(255, 255, 255, 0.5);
  font-weight: var(--fw-medium);
}

.signup-link a {
  color: var(--da-gold);
  text-decoration: none;
  font-weight: var(--fw-bold);
  transition: color 0.2s ease;
}

.signup-link a:hover {
  color: var(--da-gold-light);
  text-decoration: underline;
}

/* ============================================
   ALERT MESSAGES (Glass)
   ============================================ */

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: var(--fs-base);
  border: 1px solid;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: var(--fw-medium);
}

.alert-error,
.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.alert-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

/* ============================================
   LEGAL LINKS
   ============================================ */

.legal-links {
  margin-top: 20px;
  text-align: center;
  font-size: var(--fs-xs);
}

.legal-links a {
  color: var(--color-text-faint);
  margin: 0 8px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-links a:hover {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

/* ============================================
   SKIP-TO-CONTENT (Accessibility)
   ============================================ */

.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
  padding: 12px 24px;
  background: var(--da-royal);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  text-decoration: none;
  border-radius: 0 0 12px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.skip-to-content:focus {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  overflow: visible;
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(var(--da-gold-rgb), 0.8);
  outline-offset: 3px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .auth-shell {
    max-width: 580px;
    flex-direction: column;
    min-height: unset;
  }

  .auth-cover {
    padding: 40px 30px;
    min-height: 260px;
  }

  .cover-logo {
    font-size: 3.25rem;
  }

  .cover-subtitle {
    font-size: var(--fs-md);
  }
}

@media (max-width: 560px) {
  body {
    padding: 16px;
  }

  .auth-shell {
    border-radius: 20px;
  }

  .auth-form {
    padding: 28px;
  }

  .cover-logo {
    font-size: 3rem;
  }
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  /* Loading feedback stays meaningful for motion-sensitive users */
  .role-btn--loading .role-btn__arrow::after {
    animation-duration: 0.65s !important;
    animation-iteration-count: infinite !important;
  }
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes authReveal {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes coverFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

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

.auth-animate-shell {
  animation: authFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-animate-1 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
.auth-animate-2 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both; }
.auth-animate-3 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.auth-animate-4 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both; }
.auth-animate-5 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both; }
.auth-animate-6 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both; }
.auth-animate-7 { animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both; }

/* ============================================
   COVER PANEL ENHANCEMENTS — Feature List
   ============================================ */

.cover-features {
  margin-top: 40px;
  text-align: left;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.cover-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
}

.cover-feature + .cover-feature {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cover-feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
}

.cover-feature-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cover-feature-text {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* ============================================
   PASSWORD TOGGLE
   ============================================ */

.input-group {
  position: relative;
}

.input-group .form-input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.password-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .icon-hide { display: none; }
.password-toggle.is-visible .icon-show { display: none; }
.password-toggle.is-visible .icon-hide { display: block; }

/* ============================================
   SUBMIT BUTTON — Loading State
   ============================================ */

.submit-button--loading,
.submit-btn--loading {
  pointer-events: none;
  opacity: 0.85;
}

.submit-button--loading .btn-text,
.submit-btn--loading .btn-text {
  opacity: 0;
}

.submit-button--loading .btn-spinner,
.submit-btn--loading .btn-spinner {
  display: block;
}

.btn-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.65s linear infinite;
}

@keyframes authSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   AUTH CARD — Single-card layout for
   OTP, forgot password, reset password
   ============================================ */

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Top specular line (matches auth-shell) */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2) 25%,
      rgba(255, 255, 255, 0.35) 50%,
      rgba(255, 255, 255, 0.2) 75%,
      transparent);
  pointer-events: none;
  z-index: 5;
}

.auth-card-header {
  background: linear-gradient(135deg,
      rgba(var(--da-royal-rgb), 0.9) 0%,
      rgba(var(--da-royal-rgb), 0.7) 50%,
      rgba(15, 30, 60, 0.85) 100%);
  padding: 44px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Ambient glow for card header */
.auth-card-header::before {
  content: '';
  position: absolute;
  inset: -80px;
  background:
    radial-gradient(circle at 30% 40%, rgba(var(--da-gold-rgb), 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(var(--da-silver-rgb), 0.1) 0%, transparent 50%);
  filter: blur(30px);
  pointer-events: none;
}

.auth-card-header > * {
  position: relative;
  z-index: 1;
}

.auth-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-card-icon svg {
  width: 28px;
  height: 28px;
  stroke: rgba(255, 255, 255, 0.9);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-card-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--fw-extrabold);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-card-subtitle {
  font-size: var(--fs-md);
  color: rgba(255, 255, 255, 0.6);
  font-weight: var(--fw-medium);
}

.auth-card-body {
  padding: 36px;
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   OTP DIGIT INPUT
   ============================================ */

.otp-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 28px 0;
}

.otp-digit {
  width: 52px;
  height: 58px;
  font-size: 26px;
  font-weight: var(--fw-bold);
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  color: #fff;
  caret-color: var(--da-gold);
}

.otp-digit:focus {
  outline: none;
  border-color: rgba(var(--da-gold-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--da-gold-rgb), 0.15),
              0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.06);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.otp-digit.filled {
  border-color: rgba(var(--da-gold-rgb), 0.4);
  background: linear-gradient(135deg, rgba(var(--da-gold-rgb), 0.08) 0%, rgba(var(--da-gold-rgb), 0.03) 100%);
  animation: otpPop 0.18s ease;
}

@keyframes otpPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* All 6 digits in — brief success tint before auto-submit */
.otp-digit--complete,
.otp-digit.filled.otp-digit--complete {
  border-color: var(--color-success);
}

.otp-digit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Server rejected the code — shake the group and tint the borders red.
   Neutralized by the global prefers-reduced-motion block above. */
.otp-input-group--error .otp-digit {
  border-color: rgba(239, 68, 68, 0.55);
  animation: otpShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes otpShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* ============================================
   EMAIL SENT CALLOUT
   ============================================ */

.auth-callout {
  background: linear-gradient(135deg, rgba(var(--da-gold-rgb), 0.08) 0%, rgba(var(--da-gold-rgb), 0.03) 100%);
  border-left: 3px solid var(--da-gold);
  padding: 14px 16px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 24px;
}

.auth-callout p {
  margin: 0;
  font-size: var(--fs-base);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.auth-callout strong {
  color: var(--da-gold-light);
  word-break: break-all;
}

/* ============================================
   RESEND SECTION (OTP)
   ============================================ */

.resend-section {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.resend-text {
  font-size: var(--fs-base);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.resend-button {
  background: transparent;
  color: var(--da-gold);
  border: 1.5px solid rgba(var(--da-gold-rgb), 0.4);
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: var(--fs-base);
  font-family: inherit;
}

.resend-button:hover {
  background: rgba(var(--da-gold-rgb), 0.12);
  border-color: rgba(var(--da-gold-rgb), 0.6);
  transform: translateY(-1px);
}

.resend-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.timer-badge {
  display: inline-block;
  background: rgba(var(--da-gold-rgb), 0.1);
  color: var(--da-gold-light);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-left: 6px;
}

.timer-badge.expired {
  background: rgba(239, 68, 68, 0.1);
  color: rgba(239, 68, 68, 0.9);
}

/* ============================================
   PASSWORD STRENGTH METER
   ============================================ */

.password-strength {
  margin-top: 10px;
  margin-bottom: 16px;
}

.password-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.35s ease, background 0.35s ease;
  width: 0;
}

.password-strength-fill[data-score="1"] { width: 25%; background: var(--color-error); }
.password-strength-fill[data-score="2"] { width: 50%; background: var(--color-warning); }
.password-strength-fill[data-score="3"] { width: 75%; background: var(--da-gold); }
.password-strength-fill[data-score="4"] { width: 100%; background: var(--color-success); }

.password-strength-text {
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  margin-top: 6px;
  text-align: right;
}

/* ============================================
   REQUIREMENTS BOX
   ============================================ */

.auth-requirements {
  background: linear-gradient(135deg, rgba(var(--da-gold-rgb), 0.06) 0%, rgba(var(--da-gold-rgb), 0.02) 100%);
  border-left: 3px solid rgba(var(--da-gold-rgb), 0.5);
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 0 12px 12px 0;
}

.auth-requirements p {
  margin: 0 0 8px;
  font-size: var(--fs-base);
  color: rgba(255, 255, 255, 0.7);
  font-weight: var(--fw-semibold);
}

.auth-requirements ul {
  margin: 0;
  padding-left: 20px;
  font-size: var(--fs-base);
  color: rgba(255, 255, 255, 0.5);
}

.auth-requirements li {
  margin-bottom: 4px;
  line-height: 1.5;
}

.auth-requirements li.met {
  color: var(--color-success);
}

.auth-requirements li.met::marker {
  content: '✓ ';
}

/* ============================================
   SHARED BUTTON VARIANT — Card pages
   ============================================ */

.auth-submit {
  width: 100%;
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--da-royal) 0%, var(--da-silver) 100%);
  color: #fff;
  border: 1.5px solid rgba(var(--da-gold-rgb), 0.25);
  border-radius: 12px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(var(--da-gold-rgb), 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(var(--da-royal-rgb), 0.95) 0%, rgba(var(--da-royal-rgb), 0.85) 100%);
  box-shadow: 0 8px 25px rgba(var(--da-gold-rgb), 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-submit:hover::before { opacity: 1; }
.auth-submit:active { transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================================
   BACK LINK — Card pages
   ============================================ */

.auth-back-link {
  display: block;
  text-align: center;
  margin-top: 24px;
}

.auth-back-link a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  transition: color 0.2s ease;
}

.auth-back-link a:hover {
  color: var(--da-gold-light);
}

/* ============================================
   RESPONSIVE — Card pages
   ============================================ */

@media (max-width: 560px) {
  .auth-card {
    border-radius: 18px;
  }

  .auth-card-header {
    padding: 32px 24px;
  }

  .auth-card-title {
    font-size: 1.375rem;
  }

  .auth-card-body {
    padding: 28px 24px;
  }

  .otp-digit {
    width: 44px;
    height: 50px;
    font-size: 22px;
  }
}

@media (max-width: 380px) {
  .otp-input-group {
    gap: 6px;
  }

  .otp-digit {
    width: 38px;
    height: 44px;
    font-size: 20px;
  }
}

/* ============================================
   SOCIAL LOGIN BUTTONS
   ============================================ */

.social-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 16px;
  color: rgba(255, 255, 255, 0.45);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.social-divider span {
  padding: 0 12px;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.social-btn--govbr {
  color: #93b5e8;
  border-color: rgba(19, 81, 180, 0.5);
}

.social-btn--govbr:hover {
  background: rgba(19, 81, 180, 0.15);
  border-color: rgba(19, 81, 180, 0.7);
  color: #b0ccf5;
}

.social-btn--google {
  color: rgba(255, 255, 255, 0.8);
}

.social-btn--google:hover {
  background: rgba(255, 255, 255, 0.08);
}

.social-btn-icon {
  flex-shrink: 0;
}

.auth-next-hint {
  margin-top: 18px;
  text-align: center;
  font-size: var(--fs-xs, 0.75rem);
  color: var(--color-text-faint);
}

/* ── Role selection page ────────────────────────────────────────── */
.select-role-card {
  max-width: 480px;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-base, 1rem);
  font-weight: var(--fw-medium, 500);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-align: left;
}

.role-btn:hover,
.role-btn:focus-visible {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--da-gold, #3b82f6);
  outline: none;
  transform: translateY(-1px);
}

.role-btn:active {
  transform: translateY(0);
}

.role-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
  color: var(--da-gold-light, #60a5fa);
}

.role-btn__label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.role-btn__name {
  font-weight: var(--fw-semibold, 600);
}

.role-btn__desc {
  font-size: var(--fs-xs, 0.75rem);
  font-weight: var(--fw-normal, 400);
  color: var(--color-text-faint);
  line-height: 1.35;
}

.role-btn__arrow {
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  transition: transform 0.15s ease;
}

.role-btn:hover .role-btn__arrow,
.role-btn:focus-visible .role-btn__arrow {
  transform: translateX(3px);
  color: var(--da-gold, #3b82f6);
}

/* Loading state — chosen role spins, the rest lock down */
.role-btn--loading {
  pointer-events: none;
  border-color: var(--da-gold, #3b82f6);
  background: rgba(59, 130, 246, 0.18);
}

.role-btn--loading .role-btn__arrow svg {
  display: none;
}

.role-btn--loading .role-btn__arrow::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: roleSpin 0.65s linear infinite;
}

@keyframes roleSpin {
  to { transform: rotate(360deg); }
}

.role-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
