/* ══════════════════════════════════════════════════════
   AUTH PAGES — Login, OTP, Profile setup
   Layout: brand panel (left) + form panel (right) on desktop
           compact brand strip on top + form below on mobile
   ══════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--color-white);
}

.auth-panel { min-height: 100vh; min-width: 0; }

/* ─── Brand panel (left on desktop) ─── */
.auth-panel--brand {
  background: var(--gradient-hero);
  color: var(--color-text-white);
  padding: clamp(1.5rem, 3vw, var(--space-12)) clamp(1.25rem, 3vw, var(--space-10));
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
  overflow: hidden;
}
.auth-panel--brand::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 153, 51, 0.18), transparent 38%),
    radial-gradient(circle at 92% 92%, rgba(30, 144, 214, 0.22), transparent 42%);
  pointer-events: none;
}
.auth-panel--brand > * { position: relative; z-index: 1; }

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.auth-brand-mark,
.auth-brand-coe {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--saffron-400);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.auth-brand-logo div { display: grid; gap: 0.1rem; line-height: 1.2; }
.auth-brand-logo div span:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}
.auth-brand-logo div span:last-child {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.auth-brand-content {
  display: flex; flex-direction: column;
  gap: var(--space-4);
}
.auth-brand-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--saffron-300);
  background: rgba(255, 153, 51, 0.12);
  border: 1px solid rgba(255, 153, 51, 0.25);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
}
.auth-brand-content h2 {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 22ch;
}
.auth-brand-content p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 38ch;
  margin: 0;
}

/* Bullet list (login + OTP) */
.auth-brand-list {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  padding: 0; margin: 0;
}
.auth-brand-list li {
  display: flex; align-items: flex-start; gap: 0.55rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
}
.auth-brand-list li i {
  color: var(--saffron-300);
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Quote (login) */
.auth-brand-quote {
  display: flex; gap: 0.85rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.auth-brand-quote p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  font-style: italic;
  line-height: 1.5;
  margin: 0 0 0.4rem;
}
.auth-brand-quote strong {
  display: block;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.auth-brand-quote span {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}
.auth-brand-student__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ry-blue-deep);
  background: linear-gradient(135deg, var(--saffron-300), #fff);
  flex-shrink: 0;
}

/* Stats row (login) */
.auth-brand-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.auth-brand-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.6rem;
  text-align: center;
}
.auth-brand-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--saffron-300);
  letter-spacing: -0.01em;
}
.auth-brand-stat span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

/* Tip card (OTP page) */
.auth-brand-tip {
  display: flex; gap: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--saffron-400);
  border-radius: var(--radius-md);
  padding: 0.85rem var(--space-4);
}
.auth-brand-tip i {
  color: var(--saffron-300);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.auth-brand-tip strong {
  display: block;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.auth-brand-tip span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.5;
}
.auth-brand-tip em {
  font-style: normal;
  color: var(--saffron-300);
  font-weight: 600;
}

/* "Next up" preview (OTP page) */
.auth-brand-next {
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid; gap: 0.3rem;
}
.auth-brand-next__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.auth-brand-next strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}
.auth-brand-next p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0;
}

/* Perks grid (Profile page) */
.auth-brand-perks {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  padding: 0; margin: 0;
}
.auth-brand-perks li {
  display: flex; gap: 0.7rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.7rem var(--space-3);
}
.auth-brand-perks__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  background: rgba(255, 153, 51, 0.18);
  color: var(--saffron-300);
}
.auth-brand-perks__icon--blue  { background: rgba(30, 144, 214, 0.22); color: #5fb6e9; }
.auth-brand-perks__icon--green { background: rgba(34, 197, 94, 0.22); color: #4ade80; }
.auth-brand-perks__icon--rose  { background: rgba(244, 63, 94, 0.22); color: #fca5b8; }
.auth-brand-perks li > div { display: grid; gap: 0.1rem; line-height: 1.35; }
.auth-brand-perks strong {
  font-size: 0.88rem;
  color: #fff;
  font-weight: 700;
}
.auth-brand-perks span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Privacy promise (Profile page) */
.auth-brand-promise {
  display: flex; gap: 0.7rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem var(--space-4);
}
.auth-brand-promise i {
  color: #4ade80;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.auth-brand-promise strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.auth-brand-promise span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  line-height: 1.5;
}

.auth-brand-footer {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-3);
}
.auth-brand-footer i { color: var(--saffron-300); }

/* ─── Form panel (right on desktop) ─── */
.auth-panel--form {
  background: var(--color-white);
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, var(--space-8));
}
.auth-form-wrap {
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: var(--space-5);
}
.auth-steps {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.auth-step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.auth-step span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.auth-step--active { color: var(--ry-blue-deep); }
.auth-step--active span {
  background: var(--ry-blue-deep);
  color: #fff;
  border-color: var(--ry-blue-deep);
}
.auth-step--done { color: var(--green-600); }
.auth-step--done span {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-700);
}
.auth-step-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  min-width: 12px;
}
.auth-step-line--done { background: var(--green-500); }

.auth-form-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ry-blue-deep);
  margin: 0;
}
.auth-form-header p {
  margin-top: 0.4rem;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}
.auth-form-header__back { margin-bottom: 0.5rem; }
.auth-form-header__back a {
  display: inline-flex; align-items: center; gap: 0.25rem;
  color: var(--ry-blue);
  font-weight: 600;
  font-size: 0.82rem;
}
.auth-form-header__back a:hover { color: var(--ry-saffron-deep); }

.phone-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.phone-input-wrap:focus-within {
  border-color: var(--ry-blue);
  box-shadow: 0 0 0 3px var(--ry-blue-soft);
}
.phone-input-prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 var(--space-3);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  font-weight: 600;
  color: var(--ry-blue-deep);
}
.phone-input-flag {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
}
.phone-input {
  border: none;
  min-height: 48px;
}
.phone-input:focus { outline: none; }

.auth-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.auth-divider span {
  background: #fff;
  padding: 0 0.7rem;
  position: relative;
  z-index: 1;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  border-top: 1px solid var(--color-border);
}

.auth-alt-links {
  display: grid;
  gap: var(--space-2);
}
.auth-alt-link {
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  padding: 0 var(--space-3);
  transition: all var(--transition-fast);
}
.auth-alt-link:hover {
  border-color: var(--ry-blue);
  color: var(--ry-blue-deep);
  background: var(--ry-blue-soft);
}
.auth-terms {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  text-align: center;
}
.auth-terms a { color: var(--ry-blue); font-weight: 600; }

/* OTP boxes */
.otp-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0 var(--space-4);
  flex-wrap: wrap;
}
.otp-box {
  width: 48px;
  height: 56px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--ry-blue-deep);
  transition: all var(--transition-fast);
}
.otp-box:focus {
  border-color: var(--ry-blue);
  box-shadow: 0 0 0 3px var(--ry-blue-soft);
  outline: none;
}
.otp-divider {
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 1.2rem;
}
.otp-resend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
}
.otp-resend-btn {
  color: var(--ry-blue);
  font-weight: 700;
  background: transparent;
  border: 0;
  font-size: 0.85rem;
  cursor: pointer;
}
.otp-resend-btn:disabled { color: var(--color-text-muted); cursor: not-allowed; }
.otp-timer { font-weight: 700; color: var(--ry-saffron-deep); }
.auth-otp-hint {
  margin-top: var(--space-3);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem;
}
.auth-otp-hint code {
  background: var(--color-surface);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  color: var(--ry-blue-deep);
  font-weight: 700;
}

/* Profile form grid */
.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.profile-form-grid .full-span { grid-column: 1 / -1; }
.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 3rem; }
.password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-text-muted);
}
.password-toggle:hover { color: var(--ry-blue); }
.password-strength {
  margin-top: var(--space-2);
  min-height: 18px;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pwd-bar {
  height: 6px;
  width: 90px;
  background: color-mix(in srgb, var(--color-border) 70%, white 30%);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.pwd-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--fill);
  background: var(--color);
}

/* ═══════════════ RESPONSIVE ═══════════════ */
/* Tablets and below — brand panel becomes a top strip */
@media (max-width: 960px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }
  .auth-panel {
    min-height: auto;
  }
  .auth-panel--brand {
    padding: var(--space-5) var(--space-4) var(--space-6);
    gap: var(--space-4);
  }
  .auth-brand-content { gap: var(--space-3); }
  .auth-brand-content h2 { font-size: 1.35rem; max-width: 100%; }
  .auth-brand-content p { font-size: 0.88rem; max-width: 100%; }

  /* Hide secondary "rich" content on mobile — keep only logo + headline + 3 stats/perks */
  .auth-brand-list,
  .auth-brand-quote,
  .auth-brand-tip,
  .auth-brand-next,
  .auth-brand-promise { display: none; }
  .auth-brand-perks { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
  .auth-brand-perks li { padding: 0.5rem 0.7rem; }
  .auth-brand-perks__icon { width: 32px; height: 32px; font-size: 0.95rem; }
  .auth-brand-perks strong { font-size: 0.82rem; }
  .auth-brand-perks span { font-size: 0.72rem; }
  .auth-brand-stats { gap: 0.5rem; }
  .auth-brand-stat { padding: 0.5rem 0.4rem; }
  .auth-brand-stat strong { font-size: 1rem; }

  .auth-brand-footer { padding-top: var(--space-2); font-size: 0.72rem; }

  .auth-panel--form {
    padding: var(--space-5) var(--space-4) var(--space-8);
    place-items: start center;
  }
  .auth-form-wrap { gap: var(--space-4); }
}

/* Small phones */
@media (max-width: 520px) {
  .auth-panel--brand {
    padding: var(--space-4) var(--space-4) var(--space-5);
    gap: var(--space-3);
  }
  .auth-brand-mark, .auth-brand-coe { font-size: 1.7rem; }
  .auth-brand-logo div span:first-child { font-size: 0.95rem; }
  .auth-brand-content h2 { font-size: 1.2rem; }
  .auth-brand-content p { font-size: 0.85rem; }

  /* Hide perks on smallest screens to keep above-fold form visible */
  .auth-brand-perks,
  .auth-brand-stats { display: none; }

  .auth-form-header h1 { font-size: 1.4rem; }
  .auth-form-header p { font-size: 0.85rem; }

  .auth-steps { gap: 0.3rem; }
  .auth-step { font-size: 0.72rem; gap: 0.3rem; }
  .auth-step span { width: 22px; height: 22px; font-size: 0.7rem; }

  .profile-form-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .otp-inputs { gap: 0.35rem; }
  .otp-box {
    width: 40px;
    height: 50px;
    font-size: 1.2rem;
  }
  .otp-divider { font-size: 1rem; }
}

/* Tightest phones */
@media (max-width: 380px) {
  .otp-box { width: 36px; height: 46px; font-size: 1.05rem; }
  .otp-inputs { gap: 0.25rem; }
  .otp-divider { display: none; }
}
