/* =============================================================================
   Skairova — Auth Page  (Sign in · Sign up · Reset password)
   ============================================================================= */

/* ── Variables ── */
:root {
  --auth-accent: 120, 150, 255;
  --auth-purple: #8b43f5;
  --auth-purple-2: #a047df;
  --auth-brand-bg: #090d1a;
  --auth-card-bg: rgba(17, 24, 45, .97);
  --auth-border: rgba(154, 181, 225, .18);
  --auth-input-bg: rgba(255, 255, 255, .055);
  --auth-input-border: rgba(154, 181, 225, .22);
  --auth-text: #f0f2fb;
  --auth-muted: rgba(200, 210, 240, .58);
  --auth-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Reset for this page ── */
*, *::before, *::after { box-sizing: border-box; }

.auth-page {
  min-height: 100dvh;
  margin: 0;
  font-family: var(--auth-font);
  background: var(--auth-brand-bg);
  overflow-x: hidden;
}

/* ── Top bar ── */
.auth-page .topbar.platform-header {
  padding: 0 !important;
  display: block !important;
}

/* ── Two-column layout ── */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100dvh - var(--platform-header-h, 64px));
  box-sizing: border-box;
}

/* ── Brand panel (left) ── */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 56px 48px;
  background:
    radial-gradient(900px 700px at 20% 30%, rgba(139, 67, 245, .28), transparent 62%),
    radial-gradient(700px 500px at 80% 80%, rgba(37, 99, 235, .22), transparent 60%),
    linear-gradient(160deg, #0d1428 0%, #090d1a 100%);
  overflow: hidden;
}

.auth-brand-glow {
  position: absolute;
  top: 15%; left: -10%;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,150,255,.12), transparent 70%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.08); }
}

.auth-brand-logo {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 52px;
  text-decoration: none;
}

.auth-brand-logo-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #818CF8 0%, #A78BFA 55%, #C084FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.auth-brand-logo-sub {
  font-size: 11px;
  color: var(--auth-muted);
  font-weight: 500;
  letter-spacing: .04em;
}

/* Flight path illustration */
.auth-brand-visual {
  position: relative;
  margin-bottom: 44px;
  height: 180px;
}

.auth-brand-visual svg {
  width: 100%;
  height: 100%;
}

.flight-path {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: draw-path 2.4s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes draw-path {
  to { stroke-dashoffset: 0; }
}

.flight-plane {
  animation: fly-in .6s cubic-bezier(.4,0,.2,1) 2.2s both;
}

@keyframes fly-in {
  from { opacity: 0; transform: translate(-20px, 10px) scale(.7); }
  to   { opacity: 1; transform: translate(0, 0) scale(1); }
}

.auth-brand-tag {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  color: #f0f4ff;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.auth-brand-tag span {
  background: linear-gradient(90deg, rgba(var(--auth-accent),1), var(--auth-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand-sub {
  font-size: 14px;
  color: var(--auth-muted);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 340px;
}

.auth-brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(210, 220, 250, .82);
  font-weight: 500;
}

.auth-brand-feature-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(var(--auth-accent), .12);
  border: 1px solid rgba(var(--auth-accent), .2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
}

/* Floating dots decoration */
.auth-brand-dots {
  position: absolute;
  right: 0; bottom: 0;
  opacity: .18;
  pointer-events: none;
}

/* ── Form panel (right) ── */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px 40px;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(120,150,255,.06), transparent 60%),
    rgba(11, 16, 31, .98);
  border-left: 1px solid rgba(255,255,255,.05);
  min-height: calc(100dvh - var(--platform-header-h, 64px));
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

/* ── Mode header ── */
.auth-mode-header {
  margin-bottom: 24px;
}

.auth-mode-title {
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 800;
  color: var(--auth-text);
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 0 0 6px;
}

.auth-mode-hint {
  font-size: 13.5px;
  color: var(--auth-muted);
  margin: 0;
}

.auth-mode-hint-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  color: rgba(var(--auth-accent), 1);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}

.auth-mode-hint-btn:hover { opacity: .8; }

/* ── Alerts ── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  animation: slide-down .2s ease;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-alert.is-success {
  border: 1px solid rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .08);
  color: rgba(134, 239, 172, .95);
}

.auth-alert.is-danger {
  border: 1px solid rgba(239, 68, 68, .3);
  background: rgba(239, 68, 68, .07);
  color: rgba(252, 165, 165, .95);
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  min-height: 36px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: var(--auth-font);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--auth-muted);
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}

.auth-tab[aria-selected="true"] {
  background: rgba(var(--auth-accent), .16);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

/* ── Forms (animated transitions) ── */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.is-active {
  display: flex;
  animation: form-enter .28s cubic-bezier(.4,0,.2,1);
}

.auth-form.is-exiting {
  display: flex;
  animation: form-exit .2s cubic-bezier(.4,0,.2,1) forwards;
}

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

@keyframes form-exit {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-10px); }
}

/* ── Two-column form row ── */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Floating label field ── */
.fl-group {
  position: relative;
}

.fl-group input,
.fl-group select {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--auth-input-border);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-family: var(--auth-font);
  font-size: 14px;
  padding: 20px 14px 6px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}

.fl-group input::placeholder {
  color: transparent;
}

.fl-group label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-muted);
  pointer-events: none;
  transition: top .18s ease, font-size .18s ease, color .18s ease, transform .18s ease;
  transform-origin: left center;
  white-space: nowrap;
}

/* Float up when focused OR has value (placeholder trick via :not(:placeholder-shown)) */
.fl-group input:focus ~ label,
.fl-group input:not(:placeholder-shown) ~ label,
.fl-group input:-webkit-autofill ~ label {
  top: 10px;
  transform: translateY(0) scale(.77);
  color: rgba(var(--auth-accent), .9);
}

.fl-group input:focus {
  outline: none;
  border-color: rgba(var(--auth-accent), .6);
  box-shadow: 0 0 0 3px rgba(var(--auth-accent), .12);
  background: rgba(255,255,255,.07);
}

/* Valid state */
.fl-group.is-valid input {
  border-color: rgba(34,197,94,.45);
}

.fl-group.is-valid label {
  color: rgba(134,239,172,.8);
}

/* Error state */
.fl-group.is-error input {
  border-color: rgba(239,68,68,.5);
}

.fl-group.is-error label {
  color: rgba(252,165,165,.8);
}

.fl-group-hint {
  font-size: 11.5px;
  color: var(--auth-muted);
  margin-top: 4px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fl-group-hint.is-error { color: rgba(252,165,165,.85); }
.fl-group-hint.is-ok    { color: rgba(134,239,172,.85); }

/* ── Password wrapper ── */
.pw-wrap {
  position: relative;
}

.pw-wrap .fl-group { flex: 1; }

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--auth-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  padding: 0;
}

.pw-toggle:hover { border-color: rgba(255,255,255,.3); color: var(--auth-text); }
.pw-toggle svg { width: 17px; height: 17px; fill: currentColor; pointer-events: none; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye-open { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye-off  { display: block; }

/* ── Password strength ── */
.pw-strength {
  margin-top: 8px;
}

.pw-strength-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.pw-strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,.1);
  transition: background .3s ease;
}

.pw-strength-bar.lit-0 { background: #ef4444; }
.pw-strength-bar.lit-1 { background: #f97316; }
.pw-strength-bar.lit-2 { background: #eab308; }
.pw-strength-bar.lit-3 { background: #22c55e; }

.pw-strength-label {
  font-size: 11px;
  color: var(--auth-muted);
  font-weight: 500;
  transition: color .3s;
}

/* ── Password match indicator ── */
.pw-match-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0;
  transition: opacity .2s;
}

.pw-match-icon.visible { opacity: 1; }

/* ── Terms checkbox ── */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: rgba(200,210,240,.75);
  line-height: 1.5;
}

.auth-terms input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: rgba(var(--auth-accent),1);
  flex-shrink: 0;
  cursor: pointer;
}

.auth-terms a {
  color: rgba(var(--auth-accent),1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Primary submit button ── */
.auth-submit {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: var(--auth-font);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7b6ef6 0%, var(--auth-purple) 50%, #2563eb 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  box-shadow: 0 8px 28px rgba(139,67,245,.38), inset 0 1px 0 rgba(255,255,255,.2);
  transition: background-position .4s ease, box-shadow .2s, transform .1s;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit:hover {
  background-position: 100% 50%;
  box-shadow: 0 12px 36px rgba(139,67,245,.48), inset 0 1px 0 rgba(255,255,255,.2);
}

.auth-submit:active { transform: scale(.98); }

.auth-submit.is-loading {
  pointer-events: none;
  opacity: .8;
}

.auth-submit-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.auth-submit.is-loading .auth-submit-spinner { display: block; }
.auth-submit.is-loading .auth-submit-label   { display: none; }

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

/* Shake on error */
.auth-form.shake {
  animation: shake .4s cubic-bezier(.4,0,.2,1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.1);
}

/* ── Social buttons ── */
.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-social-row form { display: contents; }

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(220,228,248,.88);
  font-family: var(--auth-font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}

.auth-social-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
}

.auth-social-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ── Forgot password / inline links ── */
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: rgba(var(--auth-accent),.9);
  cursor: pointer;
  font-weight: 600;
  transition: opacity .15s;
}

.auth-inline-link:hover { opacity: .75; }

.auth-sub-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Reset flow step indicator ── */
.reset-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
}

.reset-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.reset-step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--auth-muted);
  transition: all .3s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.reset-step.is-done .reset-step-dot {
  background: rgba(34,197,94,.2);
  border-color: rgba(34,197,94,.6);
  color: #86efac;
}

.reset-step.is-active .reset-step-dot {
  background: rgba(var(--auth-accent),.2);
  border-color: rgba(var(--auth-accent),.7);
  color: rgba(var(--auth-accent),1);
  box-shadow: 0 0 0 4px rgba(var(--auth-accent),.12);
}

.reset-step-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--auth-muted);
  white-space: nowrap;
  margin-left: 6px;
}

.reset-step.is-active .reset-step-label { color: rgba(var(--auth-accent),1); }
.reset-step.is-done  .reset-step-label  { color: rgba(134,239,172,.8); }

.reset-step-line {
  flex: 1;
  height: 1.5px;
  background: rgba(255,255,255,.1);
  margin: 0 8px;
  transition: background .3s;
}

.reset-step.is-done .reset-step-line { background: rgba(34,197,94,.4); }

/* ── OTP (6-digit code) input ── */
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-box {
  width: 46px; height: 56px;
  border-radius: 12px;
  border: 1.5px solid var(--auth-input-border);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-family: var(--auth-font);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  transition: border-color .2s, box-shadow .2s, background .2s;
  caret-color: transparent;
  -webkit-appearance: none;
}

.otp-box:focus {
  outline: none;
  border-color: rgba(var(--auth-accent),.7);
  box-shadow: 0 0 0 3px rgba(var(--auth-accent),.15);
  background: rgba(255,255,255,.08);
}

.otp-box.is-filled {
  border-color: rgba(var(--auth-accent),.4);
  background: rgba(var(--auth-accent),.07);
}

/* ── Light theme overrides ── */
html[data-theme="light"] .auth-page {
  background:
    radial-gradient(1200px 500px at 10% -15%, rgba(139,92,246,.1), transparent 58%),
    radial-gradient(900px 400px at 95% -10%, rgba(59,130,246,.08), transparent 63%),
    #f0f2fb;
}

html[data-theme="light"] .auth-brand {
  background:
    radial-gradient(900px 700px at 20% 30%, rgba(139,67,245,.15), transparent 62%),
    radial-gradient(700px 500px at 80% 80%, rgba(37,99,235,.12), transparent 60%),
    linear-gradient(160deg, #1e2a4a 0%, #0f1730 100%);
}

html[data-theme="light"] .auth-form-panel {
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(120,150,255,.04), transparent 60%),
    rgba(248, 250, 255, .99);
  border-left-color: rgba(0,0,0,.07);
}

html[data-theme="light"] .auth-mode-title { color: #111827; }
html[data-theme="light"] .auth-mode-hint  { color: rgba(50, 60, 84, .72); }
html[data-theme="light"] .auth-mode-hint-btn,
html[data-theme="light"] .auth-inline-link {
  color: #5f7cff;
}

html[data-theme="light"] .auth-tabs {
  background: rgba(15, 23, 42, .045);
  border-color: rgba(15, 23, 42, .14);
}

html[data-theme="light"] .auth-tab {
  color: rgba(38, 48, 70, .78);
}

html[data-theme="light"] .auth-tab[aria-selected="true"] {
  background: rgba(119, 145, 255, .18);
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

html[data-theme="light"] .fl-group input {
  background: #fff;
  border-color: rgba(15, 23, 42, .16);
  color: #111827;
}

html[data-theme="light"] .fl-group input:focus {
  background: #fff;
  border-color: rgba(var(--auth-accent),.6);
  box-shadow: 0 0 0 3px rgba(var(--auth-accent),.1);
}

html[data-theme="light"] .fl-group label {
  color: rgba(47, 57, 80, .7);
}

html[data-theme="light"] .fl-group input:focus ~ label,
html[data-theme="light"] .fl-group input:not(:placeholder-shown) ~ label {
  color: rgba(var(--auth-accent),1);
}

html[data-theme="light"] .otp-box {
  background: #fff;
  border-color: rgba(0,0,0,.15);
  color: #111827;
}

html[data-theme="light"] .auth-divider { color: rgba(55,65,90,.5); }
html[data-theme="light"] .auth-divider::before,
html[data-theme="light"] .auth-divider::after { background: rgba(0,0,0,.1); }

html[data-theme="light"] .auth-social-btn {
  background: #fff;
  border-color: rgba(0,0,0,.12);
  color: #1f2937;
}

html[data-theme="light"] .auth-social-btn:hover {
  background: #f9fafb;
  border-color: rgba(0,0,0,.2);
}

html[data-theme="light"] .pw-toggle {
  border-color: rgba(15, 23, 42, .18);
  background: rgba(15, 23, 42, .035);
  color: rgba(47, 57, 80, .72);
}

html[data-theme="light"] .pw-toggle:hover {
  border-color: rgba(15, 23, 42, .28);
  background: rgba(15, 23, 42, .055);
  color: #111827;
}

html[data-theme="light"] .auth-terms { color: rgba(40,50,75,.75); }
html[data-theme="light"] .auth-terms a { color: rgba(var(--auth-accent),1); }

html[data-theme="light"] .reset-step-dot {
  border-color: rgba(15,23,42,.2);
  background: rgba(15,23,42,.045);
  color: rgba(47, 57, 80, .72);
}

html[data-theme="light"] .reset-step-label {
  color: rgba(47, 57, 80, .7);
}

html[data-theme="light"] .reset-step.is-active .reset-step-label {
  color: #6b84ff;
}

html[data-theme="light"] .reset-step.is-done .reset-step-dot {
  background: rgba(22, 163, 74, .1);
  border-color: rgba(22, 163, 74, .45);
  color: #15803d;
}

html[data-theme="light"] .reset-step.is-done .reset-step-label {
  color: #15803d;
}

html[data-theme="light"] .reset-step-line { background: rgba(15,23,42,.16); }
html[data-theme="light"] .reset-step.is-done .reset-step-line { background: rgba(22,163,74,.35); }

html[data-theme="light"] .fl-group-hint {
  color: rgba(50, 60, 84, .62);
}

html[data-theme="light"] .fl-group-hint.is-error { color: #dc2626; }
html[data-theme="light"] .fl-group-hint.is-ok { color: #15803d; }

/* ── Password strength — light mode ── */
html[data-theme="light"] .pw-strength-bar{
  background: rgba(0,0,0,.09);
}
html[data-theme="light"] .pw-strength-bar.lit-0 { background: #dc2626; }
html[data-theme="light"] .pw-strength-bar.lit-1 { background: #ea580c; }
html[data-theme="light"] .pw-strength-bar.lit-2 { background: #ca8a04; }
html[data-theme="light"] .pw-strength-bar.lit-3 { background: #16a34a; }
html[data-theme="light"] .pw-strength-label{
  color: rgba(55,65,90,.6);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .auth-brand {
    display: none;
  }

  .auth-page {
    --platform-header-side-pad: 16px;
  }

  .auth-form-panel {
    justify-content: flex-start;
    padding: 20px 20px 40px;
    border-left: none;
    min-height: calc(100dvh - var(--platform-header-h, 64px));
    background:
      radial-gradient(900px 500px at 50% -10%, rgba(139,67,245,.14), transparent 60%),
      radial-gradient(700px 400px at 100% 100%, rgba(37,99,235,.1), transparent 60%),
      #090d1a;
  }
}

@media (max-width: 480px) {
  .auth-page {
    --platform-header-side-pad: 14px;
  }

  .auth-form-panel {
    padding: 18px 16px 32px;
  }

  .auth-form-row { grid-template-columns: 1fr; }
  .auth-social-row { grid-template-columns: 1fr; }
  .auth-sub-links { flex-direction: column; gap: 8px; }

  .otp-box { width: 40px; height: 50px; font-size: 18px; }
  .otp-row { gap: 6px; }
}

/* ── Utility ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =============================================================================
   MOBILE REFINEMENTS  ·  Sub-480px / 380px / touch optimisation
   ============================================================================= */

@media (max-width: 480px) {
  .auth-form-panel {
    padding: 18px 14px 32px !important;
  }

  .auth-heading {
    font-size: 1.55rem !important;
    letter-spacing: -0.025em !important;
  }

  .auth-sub {
    font-size: 0.85rem !important;
    margin-top: 6px !important;
  }

  /* Input fields: min 50px height for comfortable tapping */
  .auth-input,
  .auth-select {
    min-height: 50px !important;
    font-size: 15px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
  }

  .auth-input-wrap .auth-input {
    padding-right: 44px !important;
  }

  .auth-input-icon {
    width: 44px !important;
  }

  /* Labels */
  .auth-label {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }

  /* Primary button: full-width, 52px */
  .auth-submit,
  .auth-btn-primary {
    min-height: 52px !important;
    font-size: 15px !important;
    border-radius: 13px !important;
  }

  /* Social buttons */
  .auth-social-btn {
    min-height: 48px !important;
    font-size: 13.5px !important;
    border-radius: 12px !important;
  }

  /* OTP inputs: large, easy-to-tap */
  .otp-box {
    width: 44px !important;
    height: 54px !important;
    font-size: 22px !important;
    border-radius: 11px !important;
  }

  .otp-row {
    gap: 7px !important;
  }

  /* Error / info messages */
  .auth-error-msg,
  .auth-info-msg {
    font-size: 12.5px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  /* Password strength bar */
  .auth-strength-bar {
    height: 4px !important;
    border-radius: 2px !important;
    margin-top: 6px !important;
  }

  /* Terms / sub-links */
  .auth-terms {
    font-size: 11px !important;
    line-height: 1.55 !important;
  }

  .auth-sub-links {
    font-size: 13px !important;
  }

  /* Divider */
  .auth-divider {
    margin: 18px 0 !important;
    font-size: 11.5px !important;
  }
}

@media (max-width: 380px) {
  .auth-page {
    --platform-header-side-pad: 12px;
  }

  .auth-form-panel {
    padding: 16px 12px 28px !important;
  }

  .auth-heading {
    font-size: 1.4rem !important;
  }

  .auth-input,
  .auth-select {
    min-height: 48px !important;
    font-size: 14.5px !important;
  }

  .auth-submit,
  .auth-btn-primary {
    min-height: 50px !important;
    font-size: 14.5px !important;
  }

  /* OTP: slightly smaller on very narrow screens */
  .otp-box {
    width: 38px !important;
    height: 48px !important;
    font-size: 20px !important;
    border-radius: 10px !important;
  }

  .otp-row {
    gap: 5px !important;
  }

  .auth-social-btn {
    min-height: 46px !important;
    font-size: 13px !important;
  }
}

/* iOS Safari zoom guard: auth form controls need a 16px focused font size. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 820px) {
    .auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
    .auth-page textarea,
    .auth-page select,
    .auth-input,
    .auth-select,
    .fl-group input,
    .fl-group select {
      font-size: 16px !important;
    }
  }
}
