﻿/* 23RO Robot SSO - login portal styles.
   Brand colours: SSO-BIZ-001 section 6-2. Breakpoints: mobile < 768, tablet 768-1199,
   desktop 1200-1599, large desktop >= 1600. */

@font-face {
  font-family: "Vazirmatn";
  src: url("../lib/vazirmatn/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-blue: #1A6FD1;
  --brand-blue-dark: #1459A8;
  --brand-green: #1E9E6A;
  --brand-amber: #F2B705;
  --brand-coral: #E5484D;
  --brand-core: #16241F;

  --surface: #ffffff;
  --surface-muted: #f4f7fb;
  --text: #16241F;
  --text-muted: #5b6b66;
  --border: #dde4ee;
  --shadow: 0 1px 2px rgba(22, 36, 31, .06), 0 12px 40px rgba(26, 111, 209, .10);
  --radius: 16px;
  --radius-sm: 12px;
  --control-h: 3.25rem;

  --bs-primary: var(--brand-blue);
  --bs-primary-rgb: 26, 111, 209;
  --bs-link-color: var(--brand-blue);
  --bs-link-color-rgb: 26, 111, 209;
  --bs-body-font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--surface-muted);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-sm);
}

[data-bs-theme="dark"] {
  --surface: #121a24;
  --surface-muted: #0b1118;
  --text: #e8eef5;
  --text-muted: #9fb0c2;
  --border: #253244;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 40px rgba(0, 0, 0, .35);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--surface-muted);
  --bs-link-color: #6aa8ff;
  --bs-link-color-rgb: 106, 168, 255;
}

/* Fluid base size: about 15px on phones, 16px on desktops, 17px on large screens. */
html { font-size: clamp(15px, 0.85rem + 0.25vw, 17px); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface-muted);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  z-index: -1;
  background:
    radial-gradient(40rem 30rem at 85% -10%, rgba(26, 111, 209, .14), transparent 60%),
    radial-gradient(30rem 24rem at 0% 110%, rgba(30, 158, 106, .12), transparent 60%),
    var(--surface-muted);
}

/* ---------- Shell ---------- */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.form-panel {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
}

.form-panel__inner {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
}

.form-panel__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.75rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.form-panel__footer a { text-decoration: none; }
.form-panel__footer .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.brand-panel { display: none; }

/* ---------- Brand ---------- */
.brand-lockup { display: flex; align-items: center; gap: .75rem; }
.brand-lockup__name { font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.brand-lockup__tag { font-size: .75rem; color: var(--text-muted); direction: ltr; text-align: right; letter-spacing: .02em; }
.brand-lockup--compact { margin-bottom: 1.5rem; }

.form-heading { margin-bottom: 1.5rem; }
.form-heading h1 { font-size: 1.45rem; font-weight: 800; margin-bottom: .35rem; letter-spacing: -.01em; }
.form-heading p { color: var(--text-muted); margin: 0; font-size: .95rem; }

.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-bottom: 1rem; font-size: .9rem; text-decoration: none; color: var(--text-muted);
}
.back-link:hover { color: var(--brand-blue); }

.ltr-text { direction: ltr; unicode-bidi: isolate; font-feature-settings: "tnum"; }

/* ---------- Method tabs ---------- */
.method-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  padding: .3rem;
  margin-bottom: 1.25rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.method-tabs .nav-link {
  width: 100%;
  border: 0;
  border-radius: calc(var(--radius-sm) - 4px);
  padding: .55rem .5rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.method-tabs .nav-link i { margin-inline-end: .35rem; }
.method-tabs .nav-link.active {
  color: var(--brand-blue);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(22, 36, 31, .12);
}
[data-bs-theme="dark"] .method-tabs .nav-link.active { color: #8bbcff; }

/* ---------- Controls ---------- */
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.form-text { color: var(--text-muted); font-size: .82rem; }

.form-control-lg, .btn-lg {
  min-height: var(--control-h);
  font-size: 1rem;
  border-radius: var(--radius-sm);
}
.form-control {
  background-color: var(--surface);
  border-color: var(--border);
}
.form-control:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 .25rem rgba(26, 111, 209, .18);
}
.ltr-input { direction: ltr; text-align: left; letter-spacing: .03em; }
.ltr-input::placeholder { letter-spacing: .03em; color: #9aa7b4; }

.input-icon { position: relative; }
/* Inputs with icons are left-to-right (phone, username, password), so the icon sits on the left. */
.input-icon > i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-icon > .form-control { padding-left: 2.75rem; }

.btn-primary {
  --bs-btn-bg: var(--brand-blue);
  --bs-btn-border-color: var(--brand-blue);
  --bs-btn-hover-bg: var(--brand-blue-dark);
  --bs-btn-hover-border-color: var(--brand-blue-dark);
  --bs-btn-active-bg: var(--brand-blue-dark);
  --bs-btn-active-border-color: var(--brand-blue-dark);
  --bs-btn-disabled-bg: var(--brand-blue);
  --bs-btn-disabled-border-color: var(--brand-blue);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(26, 111, 209, .25);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn { transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease; }

.alert { border-radius: var(--radius-sm); font-size: .9rem; }

/* ---------- Divider and providers ---------- */
.divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-muted); font-size: .82rem;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Provider buttons: neutral "Sign in with …" style that matches each brand's guideline (white surface,
   grey outline, official logo). One or two providers stack full width; with three or more the first (main)
   provider spans the row and the rest share two columns, an unpaired last one spanning the row, so the layout
   stays balanced when providers are added or removed. */
.provider-grid { display: grid; gap: .6rem; grid-template-columns: 1fr; }
.provider-grid--many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.provider-grid--many > .provider-btn:first-child,
.provider-grid--many > .provider-btn:last-child:nth-child(even) { grid-column: 1 / -1; }
.provider-btn.disabled { opacity: .55; pointer-events: none; }
a.provider-btn { text-decoration: none; }
.provider-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 2.9rem; padding: .5rem .9rem;
  font-size: .92rem; font-weight: 600; line-height: 1.3;
  color: #1F1F1F; background: #FFFFFF;
  border: 1px solid #747775; border-radius: var(--radius-sm);
  transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.provider-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-btn:hover:not(:disabled) { background: #F8FAFF; box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .12); color: #1F1F1F; }
.provider-btn:focus-visible { outline: 3px solid rgba(26, 111, 209, .45); outline-offset: 2px; }
.provider-btn:disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.provider-btn__lock { position: absolute; inset-inline-start: .7rem; font-size: .72rem; color: #5f6368; }
.provider-logo { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; font-size: 1.2rem; line-height: 1; text-align: center; }
.provider-logo--github { color: #181717; }
.provider-logo--yahoo { color: #6001D2; }
.provider-logo--facebook { color: #1877F2; }
[data-bs-theme="dark"] .provider-btn { color: #E3E3E3; background: #131314; border-color: #8E918F; }
[data-bs-theme="dark"] .provider-btn:hover:not(:disabled) { background: #1d1e20; color: #E3E3E3; }
[data-bs-theme="dark"] .provider-logo--github { color: #f0f6fc; }
[data-bs-theme="dark"] .provider-btn__lock { color: #9aa0a6; }

/* ---------- OTP ---------- */
.otp {
  position: relative;
  width: 100%;
  margin: .5rem auto .75rem;
}
.otp--len-4 { max-width: 16rem; }
.otp--len-5 { max-width: 20rem; }
.otp--len-6 { max-width: 24rem; }

.otp__boxes {
  display: grid;
  gap: .5rem;
  direction: ltr;
}
.otp--len-4 .otp__boxes { grid-template-columns: repeat(4, 1fr); }
.otp--len-5 .otp__boxes { grid-template-columns: repeat(5, 1fr); }
.otp--len-6 .otp__boxes { grid-template-columns: repeat(6, 1fr); }

.otp__box {
  aspect-ratio: 5 / 6;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  font-weight: 700;
  font-feature-settings: "tnum";
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.otp__box.is-filled { border-color: rgba(26, 111, 209, .55); }
.otp__box.is-active { border-color: var(--brand-blue); box-shadow: 0 0 0 .25rem rgba(26, 111, 209, .18); }
.otp__box.is-active:empty::after {
  content: ""; width: 2px; height: 1.4em; background: var(--brand-blue);
  animation: otp-caret 1s steps(1) infinite;
}
@keyframes otp-caret { 50% { opacity: 0; } }

/* The real input covers the boxes: taps, paste and iOS autofill go to it. */
.otp__input {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  font-size: 16px; /* prevents iOS zoom */
  z-index: 1;
}
.otp--invalid .otp__box { border-color: var(--brand-coral); animation: otp-shake .35s ease; }
.otp--busy .otp__box { opacity: .6; }
@keyframes otp-shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.resend { text-align: center; margin-top: 1rem; font-size: .88rem; color: var(--text-muted); }
.resend__btn { font-weight: 600; text-decoration: none; }

/* ---------- Account ---------- */
.success-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.25rem; height: 3.25rem; margin-bottom: .75rem;
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--brand-green);
  background: rgba(30, 158, 106, .12);
}
.success-badge--error { color: var(--brand-coral); background: rgba(229, 72, 77, .12); }

.level-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.level-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.level-steps__item { display: flex; align-items: center; gap: .75rem; color: var(--text-muted); }
.level-steps__dot {
  flex: none;
  width: 2rem; height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: .85rem; font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface);
}
.level-steps__text { display: flex; flex-direction: column; line-height: 1.4; }
.level-steps__text small { font-size: .78rem; }
.level-steps__item.is-done { color: var(--text); }
.level-steps__item.is-done .level-steps__dot { color: #fff; background: var(--brand-green); border-color: var(--brand-green); }
.level-steps__item.is-next .level-steps__dot { color: var(--brand-blue); border-color: var(--brand-blue); }

/* ---------- Tablet (768+) ---------- */
@media (min-width: 768px) {
  .form-panel { align-items: center; padding: 2.5rem 1.5rem; }
  .form-panel__inner { max-width: 30rem; padding: 2.25rem 2.25rem 1.75rem; }
  .form-heading h1 { font-size: 1.6rem; }
}

/* ---------- Desktop (1200+): split screen with brand panel ---------- */
@media (min-width: 1200px) {
  .auth-shell { padding: 2rem; gap: 2rem; max-width: 1320px; margin: 0 auto; align-items: center; }
  .brand-panel {
    display: flex;
    flex: 0 0 46%;
    align-self: stretch;
    min-height: calc(100vh - 4rem);
    border-radius: calc(var(--radius) + 8px);
    color: #fff;
    background:
      radial-gradient(28rem 22rem at 100% 0%, rgba(30, 158, 106, .45), transparent 60%),
      radial-gradient(24rem 20rem at 0% 100%, rgba(242, 183, 5, .25), transparent 60%),
      linear-gradient(160deg, #1A6FD1 0%, #134f96 45%, #16241F 100%);
    position: relative;
    overflow: hidden;
  }
  .brand-panel__inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    padding: 3rem;
    width: 100%;
  }
  .brand-lockup--light .brand-lockup__tag { color: rgba(255, 255, 255, .75); }
  .brand-panel__title {
    margin-top: auto;
    font-size: 2.3rem; font-weight: 800; line-height: 1.45;
    letter-spacing: -.01em;
  }
  .brand-panel__list { list-style: none; padding: 0; margin: 1.75rem 0 auto; display: grid; gap: .9rem; }
  .brand-panel__list li { display: flex; align-items: center; gap: .85rem; font-size: 1rem; color: rgba(255, 255, 255, .92); }
  .brand-panel__list i {
    width: 2.25rem; height: 2.25rem; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
  }
  .brand-panel__arcs {
    position: absolute; inset-inline-start: -7rem; bottom: -7rem;
    width: 22rem; height: 22rem; border-radius: 50%;
    border: 2.5rem solid rgba(255, 255, 255, .06);
    z-index: 0;
  }
  .brand-lockup--compact { display: none; }
  .form-panel { padding: 0; }
  .form-panel__inner { max-width: 28rem; }
}

/* ---------- Large desktop (1600+) ---------- */
@media (min-width: 1600px) {
  .auth-shell { max-width: 1520px; padding: 2.5rem; gap: 3rem; }
  .brand-panel { min-height: calc(100vh - 5rem); }
  .brand-panel__inner { padding: 4rem; }
  .brand-panel__title { font-size: 2.75rem; }
  .form-panel__inner { max-width: 31rem; padding: 2.75rem 2.75rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- Step-up ---------- */
.success-badge--info { color: var(--brand-blue); background: rgba(26, 111, 209, .12); }

.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.step-list__item {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
}
.step-list__icon {
  flex: none; width: 2.4rem; height: 2.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
}
.step-list__text { display: flex; flex-direction: column; line-height: 1.45; }
.step-list__text strong { color: var(--text); font-size: .95rem; }
.step-list__text small { font-size: .8rem; }
.step-list__item.is-done .step-list__icon { color: #fff; background: var(--brand-green); border-color: var(--brand-green); }
.step-list__item.is-next { border-color: var(--brand-blue); box-shadow: 0 0 0 .2rem rgba(26, 111, 209, .12); }
.step-list__item.is-next .step-list__icon { color: var(--brand-blue); border-color: var(--brand-blue); }

.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.qr-box img { width: min(200px, 60vw); height: auto; background: #fff; padding: .5rem; border-radius: 10px; }
.qr-box__key { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; }
.qr-box__key code { font-size: .95rem; letter-spacing: .06em; color: var(--text); word-break: normal; overflow-wrap: normal; max-width: 16rem; line-height: 1.9; }

.recovery-codes {
  list-style: none; padding: 1rem; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted);
}
.recovery-codes code { display: block; text-align: center; font-size: 1rem; color: var(--text); padding: .35rem; background: var(--surface); border-radius: 8px; }

.security-card { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.security-list { margin: 0; display: grid; gap: .6rem; }
.security-list > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.security-list dt { font-weight: 600; font-size: .9rem; }
.security-list dt i { color: var(--text-muted); margin-inline-end: .35rem; }
.security-list dd { margin: 0; font-size: .88rem; color: var(--text-muted); }

/* ---------- Support ticket thread (account and admin) ---------- */
.ticket-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.ticket-thread__msg { max-width: min(46rem, 92%); padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.ticket-thread__msg.is-mine { justify-self: start; background: rgba(26, 111, 209, .07); border-color: rgba(26, 111, 209, .22); }
.ticket-thread__msg.is-staff { justify-self: end; background: rgba(30, 158, 106, .07); border-color: rgba(30, 158, 106, .25); }
.ticket-thread__who { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: .3rem; }
.ticket-thread__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
[data-bs-theme="dark"] .ticket-thread__msg.is-mine { background: rgba(106, 168, 255, .10); border-color: rgba(106, 168, 255, .25); }
[data-bs-theme="dark"] .ticket-thread__msg.is-staff { background: rgba(52, 199, 140, .10); border-color: rgba(52, 199, 140, .25); }

/* ---------- Digit boxes: phone number with country, national code (FR-UI-03) ---------- */
.phone-input__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.phone-input__country {
  display: inline-flex; align-items: center; gap: .4rem; max-width: 100%;
  padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: .88rem; line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.phone-input__country:hover, .phone-input__country:focus-visible { border-color: var(--brand-blue); box-shadow: 0 0 0 .2rem rgba(26, 111, 209, .15); }
.phone-input__country .fa-chevron-down { font-size: .7rem; color: var(--text-muted); }
.phone-input__iso {
  display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.35rem; padding: 0 .25rem;
  border-radius: 6px; background: rgba(26, 111, 209, .12); color: var(--brand-blue);
  font: 700 .72rem/1 system-ui, sans-serif; letter-spacing: .04em; direction: ltr;
}
.phone-input__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }
.phone-input__dial { font-weight: 700; font-feature-settings: "tnum"; }

.digits { position: relative; width: 100%; }
.digits.is-enhanced .digits__input {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0;
  color: transparent; caret-color: transparent; background: transparent; font-size: 16px; z-index: 1;
}
.digits__boxes { display: none; }
.digits.is-enhanced .digits__boxes {
  display: flex; direction: ltr; gap: clamp(.2rem, 1.1vw, .4rem); justify-content: center;
}
.digits__box {
  flex: 1 1 0; min-width: 0; max-width: 2.75rem; aspect-ratio: 4 / 5;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.05rem, 4.2vw, 1.4rem); font-weight: 700; font-feature-settings: "tnum";
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.digits__box--group { margin-inline-start: clamp(.2rem, 1.4vw, .55rem); }
.digits__box.is-optional:not(.is-filled) { border-style: dashed; }
.digits__box.is-filled { border-color: rgba(26, 111, 209, .55); }
.digits__box.is-active { border-color: var(--brand-blue); box-shadow: 0 0 0 .22rem rgba(26, 111, 209, .18); }
.digits__box.is-active:empty::after {
  content: ""; width: 2px; height: 1.2em; background: var(--brand-blue); animation: otp-caret 1s steps(1) infinite;
}
.digits--invalid .digits__box { border-color: var(--brand-coral); animation: otp-shake .35s ease; }
.digits--busy .digits__box { opacity: .6; }
@media (max-width: 380px) {
  .digits__box { border-radius: 8px; border-width: 1.25px; }
  .phone-input__name { display: none; }
}

/* Country picker modal */
.country-modal__search { position: sticky; top: 0; z-index: 2; padding-bottom: .6rem; background: var(--bs-modal-bg, var(--surface)); }
.country-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.country-list__item {
  width: 100%; display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); text-align: start;
}
.country-list__item:hover, .country-list__item:focus-visible { background: var(--surface-muted); }
.country-list__item.is-selected { border-color: rgba(26, 111, 209, .45); background: rgba(26, 111, 209, .07); }
.country-list__name { flex: 1; min-width: 0; }
.country-list__name small { color: var(--text-muted); margin-inline-start: .35rem; }
.country-list__dial { font-weight: 700; color: var(--text-muted); font-feature-settings: "tnum"; }

/* OTP single timer: gradient ring sweeping continuously over the remaining seconds, number in the centre. */
.otp-timer {
  --ring: url(#otpRing); --start: 100; --remaining: 120s;
  position: relative; width: 7.25rem; height: 7.25rem; margin: .75rem auto .35rem; display: grid; place-items: center;
}
.otp-timer svg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 4px 10px rgba(26, 111, 209, .18)); }
.otp-timer__track { fill: none; stroke: var(--border); stroke-width: 7; }
.otp-timer__bar {
  fill: none; stroke: url(#otpRing); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--start));
  transition: stroke .4s ease;
}
.otp-timer.is-running .otp-timer__bar { animation: otp-sweep var(--remaining) linear forwards; }
@keyframes otp-sweep { from { stroke-dashoffset: calc(100 - var(--start)); } to { stroke-dashoffset: 100; } }
.otp-timer__center { position: relative; display: grid; justify-items: center; line-height: 1.2; }
.otp-timer__value { font-size: 1.55rem; font-weight: 800; color: var(--brand-blue); font-feature-settings: "tnum"; transition: color .3s ease; }
.otp-timer__label { font-size: .74rem; color: var(--text-muted); }
.otp-timer.is-warn .otp-timer__bar { stroke: #e08a00; }
.otp-timer.is-warn .otp-timer__value { color: #c77700; }
.otp-timer.is-danger .otp-timer__bar { stroke: var(--brand-coral); }
.otp-timer.is-danger .otp-timer__value { color: var(--brand-coral); animation: otp-timer-pulse 1s ease-in-out infinite; }
.otp-timer.is-expired .otp-timer__bar { stroke: var(--brand-coral); stroke-dashoffset: 100; animation: none; }
.otp-timer.is-expired .otp-timer__value { color: var(--brand-coral); }
@keyframes otp-timer-pulse { 50% { transform: scale(1.08); opacity: .7; } }
.resend__btn.is-appearing { animation: resend-in .45s ease; }
@keyframes resend-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .otp-timer.is-running .otp-timer__bar { animation-duration: 0s; } .otp-timer.is-danger .otp-timer__value { animation: none; } }
.resend__wait { font-size: .82rem; color: var(--text-muted); }
.remember-device {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem;
  padding: .75rem .85rem; margin: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted);
}
.remember-device .form-check-input { float: none; margin: 0; flex: 0 0 auto; width: 1.2rem; height: 1.2rem; }
.remember-device .form-check-label { flex: 1 1 0; min-width: 0; font-weight: 600; font-size: .92rem; }
.remember-device .form-hint { flex: 1 0 100%; margin: 0; }

/* Small and medium screens (below 1200px, no brand panel): branded gradient band behind the centered card. */
@media (max-width: 1199.98px) {
  .form-panel {
    position: relative;
    padding-top: clamp(2.5rem, 9vw, 4rem);
    background:
      radial-gradient(18rem 12rem at 100% 0%, rgba(30, 158, 106, .45), transparent 65%),
      linear-gradient(160deg, #1A6FD1 0%, #134f96 70%) top / 100% clamp(11rem, 34vw, 15rem) no-repeat;
  }
  .form-panel__inner { position: relative; box-shadow: 0 18px 40px rgba(15, 35, 60, .18); border: 0; }
  [data-bs-theme="dark"] .form-panel__inner { border: 1px solid var(--border); }
}
@media (max-width: 575.98px) {
  .form-panel { padding-inline: .85rem; }
  .form-panel__inner { padding: 1.35rem 1.1rem; border-radius: 18px; }
  .form-heading h1 { font-size: 1.3rem; }
}

/* Safari 14 and older (no aspect-ratio): digit boxes keep a usable height instead of collapsing to their content. */
@supports not (aspect-ratio: 1 / 1) {
  .otp__box { min-height: 3.4rem; }
  .digits__box { min-height: 2.8rem; }
}
