/* AuthFlow Public — Scandinavian Editorial */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --af-accent:        #8B7355;
  --af-bg:            #F6F5F2;
  --af-surface:       #FFFFFF;
  --af-panel-bg:      #111111;
  --af-panel-heading:       #FFFFFF;
  --af-panel-text:          #AAAAAA;
  --af-panel-footer:        #666666;
  --af-reg-sidebar-bg:      #FFFFFF;
  --af-reg-sidebar-heading: #111111;
  --af-reg-sidebar-text:    #6B6860;
  --af-border:        #E2E0DA;
  --af-border-f:      #111111;
  --af-text:          #111111;
  --af-text-2:        #6B6860;
  --af-text-3:        #9E9C97;
  --af-btn-text:      #FFFFFF;
  --af-input-bg:      #FFFFFF;
  --af-input-border:  #D8D6D0;
  --af-error:         #B91C1C;
  --af-success:       #15803D;
  --af-radius:        3px;
  --af-t:             .2s ease;
  --af-font-display:  'Playfair Display', Georgia, serif;
  --af-font-body:     'DM Sans', system-ui, -apple-system, sans-serif;
}

html, body { margin: 0; padding: 0; }
.af-body {
  background: var(--af-bg);
  font-family: var(--af-font-body);
  color: var(--af-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ═══════════════════════════════════════
   SHARED INPUTS & BUTTONS
═══════════════════════════════════════ */

.af-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: var(--af-input-bg);
  border: 1.5px solid var(--af-input-border);
  border-radius: var(--af-radius);
  color: var(--af-text);
  font-family: var(--af-font-body);
  font-size: 15px;
  outline: none;
  transition: border-color var(--af-t);
  -webkit-appearance: none;
}
.af-input::placeholder { color: var(--af-text-3); }
.af-input:focus  { border-color: var(--af-border-f); }
.af-input.af-input--error   { border-color: var(--af-error); }
.af-input.af-input--success { border-color: var(--af-success); }

.af-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 24px;
  box-sizing: border-box;
  background: var(--af-accent);
  color: var(--af-btn-text);
  border: none;
  border-radius: var(--af-radius);
  font-family: var(--af-font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background var(--af-t), transform var(--af-t);
}
.af-submit-btn:hover    { background: #2D2C2A; }
.af-submit-btn:active   { transform: scale(.99); }
.af-submit-btn:disabled { opacity: .45; cursor: default; transform: none; }
.af-submit-btn svg      { width: 16px; height: 16px; flex-shrink: 0; }
.af-submit-btn .af-spinner { animation: af-spin 1s linear infinite; }

/* Field label */
.af-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--af-text);
  margin-bottom: 8px;
}
.af-field-label a {
  font-weight: 400;
  font-size: 13px;
  color: var(--af-text-2);
  text-decoration: none;
}
.af-field-label a:hover { color: var(--af-text); }
.af-field-group { margin-bottom: 20px; }

/* Field feedback */
.af-field-feedback {
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
  color: var(--af-text-3);
  line-height: 1.4;
}
.af-field-feedback.error   { color: var(--af-error); }
.af-field-feedback.success { color: var(--af-success); }

/* Password input */
.af-password-wrap { position: relative; }
.af-password-wrap .af-input { padding-right: 46px; }
.af-password-toggle {
  position: absolute; right: 12px;
  top: 0; bottom: 0; margin: auto 0;
  height: fit-content;
  background: none; border: none; cursor: pointer;
  color: var(--af-text-3); display: flex; align-items: center; padding: 4px;
  transition: color var(--af-t);
}
.af-password-toggle:hover { color: var(--af-text); }
.af-password-toggle svg   { width: 17px; height: 17px; }

/* Remember checkbox */
.af-remember {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; cursor: pointer;
  font-size: 14px; color: var(--af-text-2);
}
.af-remember input[type="checkbox"] { display: none; }
.af-checkbox {
  width: 17px; height: 17px;
  border: 1.5px solid var(--af-border-f);
  border-radius: 3px; background: var(--af-surface);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--af-t);
}
.af-remember input:checked ~ .af-checkbox {
  background: var(--af-accent); border-color: var(--af-accent);
}
.af-remember input:checked ~ .af-checkbox::after {
  content: '';
  width: 4px; height: 8px;
  border: 1.5px solid var(--af-btn-text, #ffffff);
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px,-1px);
  display: block;
}

/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */

.af-login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left panel ── */
.af-login-panel {
  position: relative;
  background-color: var(--af-panel-bg);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 56px;
  overflow: hidden;
}
/* Overlay for image legibility */
.af-panel-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 0;
  pointer-events: none;
}
/* Subtle depth when no image — pure neutral */
.af-login-panel:not([style*="background-image"])::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 90%, rgba(255,255,255,.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(255,255,255,.03) 0%, transparent 70%);
  pointer-events: none;
}
.af-panel-above { position: relative; z-index: 1; }

.af-panel-logo img    { width: auto; height: auto; display: block; }
.af-panel-site-name {
  font-family: var(--af-font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--af-panel-heading);
  text-decoration: none;
  letter-spacing: -.3px;
}
.af-panel-copy h2 {
  font-family: var(--af-font-display);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 400;
  color: var(--af-panel-heading);
  line-height: 1.1;
  letter-spacing: -.5px;
  margin: 0 0 18px;
}
.af-panel-copy p {
  font-size: 16px;
  color: var(--af-panel-text);
  line-height: 1.65;
  margin: 0;
  max-width: 320px;
}
.af-panel-footer {
  font-size: 12px;
  color: var(--af-panel-footer);
}

/* ── Right form panel ── */
.af-login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: var(--af-bg);
}
.af-login-form-inner {
  width: 100%; max-width: 380px;
  animation: af-fadeUp .5s ease both;
}

.af-form-headline {
  font-family: var(--af-font-display);
  font-size: 36px;
  font-weight: var(--af-font-display-weight, 600);
  letter-spacing: -.5px;
  color: var(--af-text);
  margin: 0 0 6px;
  line-height: 1.1;
}
.af-form-subtitle {
  font-size: 15px;
  color: var(--af-text-2);
  margin: 0 0 30px;
  line-height: 1.55;
}

.af-form-error {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--af-radius);
  font-size: 14px;
  color: var(--af-error);
  margin-bottom: 28px;
  animation: af-shake .4s ease both;
}
.af-form-error svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.af-login-switch {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--af-border);
  text-align: center;
  font-size: 14px;
  color: var(--af-text-2);
}
.af-login-switch a {
  color: var(--af-text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ═══════════════════════════════════════
   LOST PASSWORD PAGE – reuses .af-login-page
═══════════════════════════════════════ */

.af-lp-success-icon {
  width: 56px; height: 56px;
  border: 1.5px solid var(--af-text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  animation: af-popIn .5s cubic-bezier(.34,1.56,.64,1) both;
}
.af-lp-success-icon svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════
   REGISTER PAGE
═══════════════════════════════════════ */

.af-register-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 420px 1fr;
}

/* ── Left sidebar ── */
.af-reg-sidebar {
  background: var(--af-reg-sidebar-bg);
  border-right: 1px solid var(--af-border);
  display: flex;
  flex-direction: column;
  padding: 56px 56px;
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
.af-reg-sidebar-logo img { width: auto; height: auto; display: block; }
.af-reg-sidebar-name {
  font-family: var(--af-font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--af-reg-sidebar-heading);
}

.af-reg-sidebar-content { margin: auto 0; }
.af-reg-sidebar-content h1 {
  font-family: var(--af-font-display);
  font-size: clamp(26px, 3.5vw, 44px);
  font-weight: 400;
  color: var(--af-reg-sidebar-heading);
  letter-spacing: -.5px;
  line-height: 1.1;
  margin: 0 0 16px;
}
.af-reg-sidebar-content p {
  font-size: 15px;
  color: var(--af-reg-sidebar-text);
  line-height: 1.65;
  margin: 0;
}

/* Step tracker */
.af-step-tracker { margin-top: auto; }
.af-tracker-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--af-text-3); margin-bottom: 10px;
}
.af-step-bars { display: flex; gap: 4px; }
.af-step-bar {
  flex: 1; height: 1.5px;
  background: var(--af-border);
  border-radius: 100px;
  transition: background .4s ease;
}
.af-step-bar.done   { background: var(--af-text); }
.af-step-bar.active { background: var(--af-accent); }

/* ── Convergence mode: single animated flow bar ── */
.af-flow-bar {
  width: 100%;
  height: 1.5px;
  background: var(--af-border);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.af-flow-bar__fill {
  height: 100%;
  background: var(--af-accent);
  border-radius: 100px;
  transition: width .7s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
}
.af-flow-bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
  animation: af-flow-shimmer 2s ease-in-out infinite;
}
@keyframes af-flow-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ── Right: wizard ── */
.af-reg-main {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 72px;
  background: var(--af-bg);
  min-height: 100vh;
}
.af-wizard { width: 100%; max-width: 420px; }

/* ── Step ── */
.af-step { animation: af-stepIn .38s cubic-bezier(.4,0,.2,1) both; }

.af-step-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-family: var(--af-font-body); font-size: 13px; font-weight: 500;
  color: var(--af-text-3); padding: 0; margin-bottom: 36px;
  transition: color var(--af-t);
}
.af-step-back:hover { color: var(--af-text); }
.af-step-back svg { width: 14px; height: 14px; }

.af-step-eyebrow {
  display: block;
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--af-accent);
  margin-bottom: 10px;
}
.af-step-title {
  font-family: var(--af-font-display);
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 400; letter-spacing: -.5px; line-height: 1.1;
  color: var(--af-text); margin: 0 0 8px;
}
.af-step-sub {
  font-size: 15px; color: var(--af-text-2);
  margin: 0 0 30px; line-height: 1.6;
}

/* Tighter sub used in OTP code phase — no huge gap before inputs */
.af-otp-sent-sub {
  font-size: 14px; color: var(--af-text-2);
  margin: 0 0 20px; line-height: 1.5;
}

/* Step inputs */
.af-step-field { margin-bottom: 20px; }
.af-step-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--af-text); margin-bottom: 8px;
}
.af-step-input {
  display: block; width: 100%;
  padding: 14px 18px;
  background: var(--af-input-bg);
  border: 1.5px solid var(--af-input-border);
  border-radius: var(--af-radius);
  color: var(--af-text);
  font-family: var(--af-font-body);
  font-size: 16px; outline: none;
  transition: border-color var(--af-t);
  -webkit-appearance: none;
}
.af-step-input::placeholder { color: var(--af-text-3); font-size: 15px; }
.af-step-input:focus         { border-color: var(--af-border-f); }
.af-step-input.af-input--error   { border-color: var(--af-error); }
.af-step-input.af-input--success { border-color: var(--af-success); }

/* ── Custom radio buttons ── */
.af-custom-radio-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.af-custom-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--af-text);
  padding: 10px 14px;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius);
  background: var(--af-input-bg);
  transition: border-color .15s, background .15s;
  user-select: none;
}
.af-custom-radio-label:hover {
  border-color: var(--af-accent);
  background: var(--af-input-bg);
}
.af-custom-radio-label input[type="radio"] { display: none; }
.af-custom-radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--af-border);
  background: var(--af-input-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.af-custom-radio-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--af-accent);
  opacity: 0;
  transition: opacity .15s;
}
.af-custom-radio-label:has(input:checked) {
  border-color: var(--af-accent);
}
.af-custom-radio-label:has(input:checked) .af-custom-radio-dot {
  border-color: var(--af-accent);
}
.af-custom-radio-label:has(input:checked) .af-custom-radio-dot::after {
  opacity: 1;
}

/* ── Custom checkbox ── */
.af-custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--af-text);
  padding: 10px 14px;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius);
  background: var(--af-input-bg);
  transition: border-color .15s;
  user-select: none;
}
.af-custom-checkbox-label:hover { border-color: var(--af-accent); }
.af-custom-checkbox-label input[type="checkbox"] { display: none; }
.af-custom-checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--af-border);
  background: var(--af-input-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.af-custom-checkbox-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity .15s;
}
.af-custom-checkbox-label:has(input:checked) {
  border-color: var(--af-accent);
}
.af-custom-checkbox-label:has(input:checked) .af-custom-checkbox-box {
  background: var(--af-accent);
  border-color: var(--af-accent);
}
.af-custom-checkbox-label:has(input:checked) .af-custom-checkbox-box::after {
  opacity: 1;
}


.af-step-pw-wrap { position: relative; }
.af-step-pw-wrap .af-step-input { padding-right: 46px; }
.af-step-pw-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--af-text-3); display: flex; padding: 4px;
  transition: color var(--af-t);
}
.af-step-pw-toggle:hover { color: var(--af-text); }
.af-step-pw-toggle svg   { width: 17px; height: 17px; }

/* Two-col grid */
.af-step-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}

/* Feedback */
.af-feedback {
  font-size: 12px; margin-top: 6px; min-height: 16px;
  display: flex; align-items: center; gap: 5px;
  color: var(--af-text-3); line-height: 1.4;
}
.af-feedback svg   { width: 12px; height: 12px; flex-shrink: 0; }
.af-feedback.error   { color: var(--af-error); }
.af-feedback.success { color: var(--af-success); }

/* Password strength bars */
.af-pw-bars { display: flex; gap: 3px; margin-top: 10px; }
.af-pw-bar {
  flex: 1; height: 2px; border-radius: 100px;
  background: var(--af-border);
  transition: background .3s;
}
.af-pw-bar.weak   { background: #DC2626; }
.af-pw-bar.medium { background: #D97706; }
.af-pw-bar.strong { background: var(--af-success); }

/* Next button */
.af-next-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 24px;
  background: var(--af-accent); color: var(--af-btn-text);
  border: none; border-radius: var(--af-radius);
  font-family: var(--af-font-body); font-size: 15px; font-weight: 500;
  cursor: pointer; margin-top: 8px;
  transition: background var(--af-t), transform var(--af-t);
}
.af-next-btn:hover    { filter: brightness(.88); }
.af-next-btn:active   { transform: scale(.99); }
.af-next-btn:disabled { opacity: .4; cursor: default; transform: none; }
.af-next-btn svg { width: 16px; height: 16px; }
.af-next-btn .af-spinner { animation: af-spin 1s linear infinite; }

.af-skip-link {
  display: block; text-align: center; margin-top: 14px;
  font-size: 13px; color: var(--af-text-3);
  cursor: pointer; background: none; border: none;
  font-family: var(--af-font-body);
  transition: color var(--af-t);
}
.af-skip-link:hover { color: var(--af-text-2); }

.af-have-account {
  margin-top: 40px; padding-top: 28px;
  border-top: 1px solid var(--af-border);
  text-align: center; font-size: 14px; color: var(--af-text-2);
}
.af-have-account a {
  color: var(--af-text); font-weight: 500;
  text-decoration: none; border-bottom: 1px solid currentColor;
}

/* ── Success ── */
.af-step-success {
  text-align: center; padding: 20px 0;
  animation: af-fadeUp .5s ease both;
}
.af-success-mark {
  width: 60px; height: 60px;
  border: 1.5px solid var(--af-text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  animation: af-popIn .5s cubic-bezier(.34,1.56,.64,1) both;
}
.af-success-mark svg { width: 26px; height: 26px; }

.af-loading-dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 28px;
}
.af-loading-dots span {
  width: 6px; height: 6px;
  background: var(--af-text-3); border-radius: 50%;
  animation: af-bounce 1.2s ease infinite;
}
.af-loading-dots span:nth-child(2) { animation-delay: .2s; }
.af-loading-dots span:nth-child(3) { animation-delay: .4s; }

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */

@keyframes af-fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes af-stepIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes af-stepOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-18px); }
}
@keyframes af-spin { to { transform: rotate(360deg); } }
@keyframes af-bounce {
  0%, 80%, 100% { transform: scale(.4); opacity: .4; }
  40%           { transform: scale(1);  opacity: 1; }
}
@keyframes af-popIn {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes af-shake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-5px); }
  40%  { transform: translateX(5px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(3px); }
}


/* ═══════════════════════════════════════
   LOGO INVERSION on dark panel
═══════════════════════════════════════ */

.af-login-panel.af-panel--invert-logo .af-panel-logo img {
  filter: brightness(0) invert(1);
}

/* Register sidebar logo inversion */
.af-reg-sidebar.af-reg--invert-logo .af-reg-sidebar-logo img {
  filter: brightness(0) invert(1);
}

/* ─── Inline mobile step counter (desktop: hidden) ─── */
.af-step-mini-tracker {
  display: none;
}

/* ─── Trust bullets in register sidebar ─── */
.af-trust-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.af-trust-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--af-reg-sidebar-text);
  line-height: 1.5;
}
.af-trust-bullets li::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--af-reg-sidebar-text);
  border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/cover;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/cover;
}

/* ─── Login: stronger register CTA ─── */
.af-register-cta {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--af-border);
}
.af-register-cta p {
  font-size: 13px;
  color: var(--af-text-2);
  margin: 0 0 10px;
  text-align: center;
}
.af-register-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 24px;
  box-sizing: border-box;
  background: transparent;
  color: var(--af-text);
  border: 1.5px solid var(--af-text);
  border-radius: var(--af-radius);
  font-family: var(--af-font-body);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--af-t), color var(--af-t);
  letter-spacing: .01em;
}
.af-register-cta a:hover {
  background: var(--af-accent);
  color: #fff;
}
.af-register-cta a svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

/* ─ LOGIN ─ */
@media (max-width: 920px) {
  .af-login-page          { grid-template-columns: 1fr; }
  .af-login-panel         { display: none; }
  .af-login-form-panel {
    min-height: 100dvh;
    padding: 52px 32px 40px;
    padding-top: max(52px, env(safe-area-inset-top, 52px));
    align-items: flex-start;
  }
  .af-login-form-inner    { max-width: 100%; }
  .af-input               { font-size: 16px; }
}

/* ─ REGISTER ─ */
@media (max-width: 920px) {
  /* Full-height app, sidebar gone entirely */
  .af-register-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    grid-template-columns: unset;
  }

  /* Hide the ENTIRE sidebar: logo, copy, tracker, bullets — all of it */
  .af-reg-sidebar { display: none !important; }

  /* Wizard fills screen from very top */
  .af-reg-main {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 24px 20px;
    padding-top: max(24px, env(safe-area-inset-top, 24px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
    background: var(--af-bg);
  }
  .af-wizard { max-width: 100%; width: 100%; }

  /* Mini step tracker — visible only on mobile, sits below form */
  .af-step-mini-tracker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--af-border);
  }
  .af-step-mini-bars {
    display: flex;
    gap: 3px;
    flex: 1;
  }
  .af-step-mini-bar {
    flex: 1;
    height: 2px;
    background: var(--af-border);
    border-radius: 100px;
    transition: background .4s ease;
  }
  .af-step-mini-bar.done   { background: var(--af-text); }
  .af-step-mini-bar.active { background: var(--af-accent); }
  .af-step-mini-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--af-text-3);
    white-space: nowrap;
  }

  /* Tighter step spacing */
  .af-step-back    { margin-bottom: 16px; }
  .af-step-eyebrow { margin-bottom: 6px; font-size: 10px; }
  .af-step-title   { font-size: clamp(20px, 5.5vw, 24px); margin-bottom: 4px; line-height: 1.15; }
  .af-step-sub     { font-size: 14px; margin-bottom: 18px; }
  .af-step-field   { margin-bottom: 12px; }
  .af-step-input   { font-size: 16px; padding: 13px 16px; }
  .af-next-btn     { padding: 15px 24px; margin-top: 4px; font-size: 15px; }
  .af-have-account { margin-top: 16px; padding-top: 14px; font-size: 13px; }
  .af-step-cols    { grid-template-columns: 1fr; gap: 12px; }
}

/* Tablet 921–1100px: narrower sidebar */
@media (min-width: 921px) and (max-width: 1100px) {
  .af-register-page       { grid-template-columns: 300px 1fr; }
  .af-reg-sidebar         { padding: 40px 40px; }
  .af-reg-sidebar-content h1 { font-size: 28px; }
  .af-reg-main            { padding: 60px 48px; }
}

@media (max-width: 400px) {
  .af-login-form-panel { padding: 40px 18px 28px; }
  .af-reg-main         { padding: 20px 16px; }
  .af-step-title       { font-size: 20px; }
  .af-step-sub         { font-size: 13px; margin-bottom: 14px; }
  .af-step-field       { margin-bottom: 10px; }
}

/* ═══════════════════════════════════════
   OTP — 6-digit code input
═══════════════════════════════════════ */

.af-otp-icon {
  margin-bottom: 20px;
  color: var(--af-text-2);
}

.af-otp-inputs {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.af-otp-digit {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 54px;
  padding: 0;
  background: var(--af-input-bg);
  border: 1.5px solid var(--af-input-border);
  border-radius: var(--af-radius);
  color: var(--af-text);
  font-family: var(--af-font-body);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color var(--af-t), box-shadow var(--af-t);
  -webkit-appearance: none;
  /* prevent iOS number formatting */
  -moz-appearance: textfield;
}
.af-otp-digit:focus {
  border-color: var(--af-border-f);
  box-shadow: 0 0 0 3px rgba(26,25,22,.07);
}
.af-otp-digit.af-input--error   {
  border-color: var(--af-error);
  animation: af-shake .35s ease both;
}
.af-otp-digit.af-input--success { border-color: var(--af-success); }

.af-otp-resend {
  text-align: center;
  font-size: 13px;
  color: var(--af-text-2);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--af-border);
}
.af-resend-btn {
  background: none; border: none; cursor: pointer;
  color: var(--af-text); font-size: 13px; font-weight: 600;
  font-family: var(--af-font-body);
  text-decoration: underline;
  padding: 0; transition: color var(--af-t);
}
.af-resend-btn:hover { color: var(--af-accent); }
.af-resend-btn:disabled { opacity: .5; cursor: default; }

/* Tighter OTP boxes on small screens */
@media (max-width: 400px) {
  .af-otp-digit { font-size: 18px; }
  .af-otp-inputs { gap: 6px; }
}

/* ── OTP Login mode tabs ── */
.af-login-mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius);
  padding: 3px;
  margin-bottom: 24px;
  background: var(--af-bg);
}
.af-mode-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: calc(var(--af-radius) - 2px);
  background: none;
  font-family: var(--af-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--af-text-2);
  cursor: pointer;
  transition: all var(--af-t);
}
.af-mode-tab--active {
  background: var(--af-surface);
  color: var(--af-text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.af-otp-icon {
  text-align: center;
  margin-bottom: 16px;
  color: var(--af-text-2);
}

/* ════════════════════════════
   ACCESSIBILITY
════════════════════════════ */

/* Screen-reader only — visually hidden but readable by assistive technology */
.af-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;
}

/* Live region for AJAX feedback (errors, success) */
.af-live-region {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* JS-controlled visibility handled via inline style="display:none" in templates */

