/* ============================================================
   SADORA — Mobile Auth Pages Shared Styles
   Used by: login, signup, forgot-password, otp
   Load AFTER sadora.css
   ============================================================ */

/* ── Page ───────────────────────────────────────────────────── */
.sd-mlogin-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--sd-bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--sd-duration-slow) var(--sd-ease);
}
  .sd-mlogin-flabel {
     display: block;
     font-size: var(--sd-text-sm);
     font-weight: var(--sd-weight-semibold);
     color: var(--sd-text-secondary);
     margin: 0 0 var(--sd-space-0);
     letter-spacing: 0.01em;
   }
.sd-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Logo section ───────────────────────────────────────────── */
.sd-mlogin-top {
  display: flex;
  justify-content: center;
  padding: max(env(safe-area-inset-top), var(--sd-space-8)) 0 var(--sd-space-6);
  flex-shrink: 0;
}
.sd-mlogin-logo-ring {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--sd-surface);
  border: 1px solid color-mix(in srgb, var(--sd-primary) 18%, transparent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--sd-primary) 15%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.sd-mlogin-logo {
  width: 72px; height: 72px; border-radius: 50%;
  overflow: hidden; background: var(--sd-primary);
  display: flex; align-items: center; justify-content: center;
}
.sd-mlogin-logo__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-mlogin-logo__fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: var(--sd-weight-bold);
  font-size: var(--sd-text-xl); letter-spacing: 0.02em;
}

/* ── Back button (top-left, for sub pages) ──────────────────── */
.sd-mlogin-back {
  position: absolute;
  top: max(env(safe-area-inset-top), var(--sd-space-5));
  left: var(--sd-space-5);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--sd-surface);
  border: 1px solid var(--sd-border);
  color: var(--sd-text-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sd-shadow-sm);
  z-index: 10;
  transition: all var(--sd-duration-fast) var(--sd-ease);
  -webkit-tap-highlight-color: transparent;
}
.sd-mlogin-back:hover  { box-shadow: var(--sd-shadow-md); color: var(--sd-primary); }
.sd-mlogin-back:active { transform: scale(0.94); }

/* ── Form sheet ─────────────────────────────────────────────── */
.sd-mlogin-sheet {
  flex: 1;
  background: var(--sd-surface);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.06);
  padding: var(--sd-space-8) var(--sd-space-6) calc(var(--sd-space-12) + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  transition: background-color var(--sd-duration-slow) var(--sd-ease);
}
.sd-mlogin-heading {
  font-size: var(--sd-text-2xl);
  font-weight: var(--sd-weight-bold);
  color: var(--sd-text-primary);
  text-align: left;
  margin-bottom: var(--sd-space-2);
  letter-spacing: -0.01em;
}
.sd-mlogin-subtext {
  font-size: var(--sd-text-sm);
  color: var(--sd-text-muted);
  line-height: var(--sd-leading-loose);
  margin-bottom: var(--sd-space-6);
}
.sd-mlogin-heading + form,
.sd-mlogin-heading + .sd-mlogin-alert { margin-top: var(--sd-space-4); }

/* ── Alerts ─────────────────────────────────────────────────── */
.sd-mlogin-alert {
  display: flex; align-items: flex-start; gap: var(--sd-space-2);
  font-size: var(--sd-text-sm);
  padding: var(--sd-space-3) var(--sd-space-4);
  border-radius: 14px;
  margin-bottom: var(--sd-space-4);
  line-height: var(--sd-leading-snug);
}
.sd-mlogin-alert svg { flex-shrink: 0; margin-top: 1px; }
.sd-mlogin-alert--danger  { background: var(--sd-danger-light);  color: var(--sd-danger);  border: 1px solid color-mix(in srgb, var(--sd-danger) 22%, transparent); }
.sd-mlogin-alert--success { background: var(--sd-success-light); color: var(--sd-success); border: 1px solid color-mix(in srgb, var(--sd-success) 22%, transparent); }
.sd-mlogin-alert--info    { background: var(--sd-info-light);    color: var(--sd-info);    border: 1px solid color-mix(in srgb, var(--sd-info) 22%, transparent); }

/* ── Rounded fields ─────────────────────────────────────────── */
.sd-mlogin-field {
  display: flex; align-items: center; gap: var(--sd-space-3);
  background: var(--sd-surface-3);
  border: 1.5px solid transparent;
  border-radius: 16px;
  height: 54px;
  padding: 0 var(--sd-space-4);
  margin-bottom: var(--sd-space-4);
  transition: border-color var(--sd-duration-fast) var(--sd-ease),
              background var(--sd-duration-fast) var(--sd-ease),
              box-shadow var(--sd-duration-fast) var(--sd-ease);
}
.sd-mlogin-field:focus-within {
  background: var(--sd-input-bg);
  border-color: var(--sd-primary);
  box-shadow: 0 0 0 4px var(--sd-primary-light);
}
.sd-mlogin-field--error { border-color: var(--sd-danger); }
.sd-mlogin-field__icon {
  color: var(--sd-text-muted);
  display: flex; flex-shrink: 0;
  transition: color var(--sd-duration-fast) var(--sd-ease);
}
.sd-mlogin-field:focus-within .sd-mlogin-field__icon { color: var(--sd-primary); }
.sd-mlogin-field input,
.sd-mlogin-field select {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: var(--sd-text-base); font-family: inherit;
  color: var(--sd-text-primary); height: 100%; min-width: 0;
}
.sd-mlogin-field input::placeholder { color: var(--sd-text-muted); }
.sd-mlogin-field__toggle {
  background: none; border: none; color: var(--sd-text-muted);
  display: flex; align-items: center;
  padding: var(--sd-space-2);
  margin-right: calc(var(--sd-space-2) * -1);
  cursor: pointer; flex-shrink: 0;
  transition: color var(--sd-duration-fast) var(--sd-ease);
}
.sd-mlogin-field__toggle:hover,
.sd-mlogin-field__toggle:active { color: var(--sd-text-primary); }

/* Field hint / error text */
.sd-mlogin-hint {
  font-size: var(--sd-text-xs);
  color: var(--sd-text-muted);
  margin: calc(var(--sd-space-2) * -1) var(--sd-space-2) var(--sd-space-4);
}
.sd-mlogin-hint--error { color: var(--sd-danger); }

/* ── Links row ──────────────────────────────────────────────── */
.sd-mlogin-forgot {
  display: flex; justify-content: flex-end;
  margin: calc(var(--sd-space-1) * -1) var(--sd-space-1) var(--sd-space-6);
}
.sd-mlogin-forgot a,
.sd-mlogin-link {
  font-size: var(--sd-text-sm);
  font-weight: var(--sd-weight-medium);
  color: var(--sd-primary);
  text-decoration: none;
}
.sd-mlogin-forgot a:active,
.sd-mlogin-link:active { opacity: 0.7; }

/* ── Pill submit button ─────────────────────────────────────── */
.sd-mlogin-submit {
  width: 100%; height: 54px;
  border: none; border-radius: 27px;
  background: var(--sd-primary); color: #fff;
  font-size: var(--sd-text-md);
  font-weight: var(--sd-weight-bold);
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: var(--sd-space-2);
  margin-bottom: var(--sd-space-6);
  box-shadow: 0 10px 24px rgba(var(--sd-primary-rgb), 0.32);
  transition: all var(--sd-duration-fast) var(--sd-ease);
  -webkit-tap-highlight-color: transparent;
}
.sd-mlogin-submit:hover {
  background: var(--sd-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(var(--sd-primary-rgb), 0.40);
}
.sd-mlogin-submit:active { transform: scale(0.98); }
.sd-mlogin-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.sd-mlogin-submit.is-loading { pointer-events: none; opacity: 0.8; }
.sd-mlogin-submit.is-loading span,
.sd-mlogin-submit.is-loading svg { display: none; }
.sd-mlogin-submit.is-loading::after {
  content: '';
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sd-spin 0.6s linear infinite;
}

/* ── Bottom row text ────────────────────────────────────────── */
.sd-mlogin-signup {
  text-align: center;
  font-size: var(--sd-text-sm);
  color: var(--sd-text-muted);
}
.sd-mlogin-signup a {
  color: var(--sd-primary);
  font-weight: var(--sd-weight-bold);
  text-decoration: none;
}
.sd-mlogin-signup a:active { opacity: 0.7; }

/* ── Floating support FAB ───────────────────────────────────── */
.sd-mlogin-fab {
  position: fixed;
  bottom: calc(var(--sd-space-5) + env(safe-area-inset-bottom));
  right: var(--sd-space-5);
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--sd-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(var(--sd-primary-rgb), 0.40);
  border: 3px solid var(--sd-surface);
  z-index: 100;
  transition: all var(--sd-duration-fast) var(--sd-ease);
  -webkit-tap-highlight-color: transparent;
}
.sd-mlogin-fab:hover  { transform: translateY(-2px) scale(1.04); color: #fff; }
.sd-mlogin-fab:active { transform: scale(0.95); }

/* ── OTP boxes ──────────────────────────────────────────────── */
.sd-otp-row {
  display: flex;
  gap: var(--sd-space-3);
  justify-content: center;
  margin-bottom: var(--sd-space-6);
}
.sd-otp-box {
  width: 52px; height: 60px;
  border-radius: 16px;
  background: var(--sd-surface-3);
  border: 1.5px solid transparent;
  text-align: center;
  font-size: var(--sd-text-xl);
  font-weight: var(--sd-weight-bold);
  font-family: inherit;
  color: var(--sd-text-primary);
  outline: none;
  caret-color: var(--sd-primary);
  transition: border-color var(--sd-duration-fast) var(--sd-ease),
              background var(--sd-duration-fast) var(--sd-ease),
              box-shadow var(--sd-duration-fast) var(--sd-ease);
}
.sd-otp-box:focus {
  background: var(--sd-input-bg);
  border-color: var(--sd-primary);
  box-shadow: 0 0 0 4px var(--sd-primary-light);
}
.sd-otp-box.is-filled { border-color: var(--sd-primary); background: var(--sd-primary-light); }
.sd-otp-box.is-error  { border-color: var(--sd-danger); }

/* OTP resend timer */
.sd-otp-resend {
  text-align: center;
  font-size: var(--sd-text-sm);
  color: var(--sd-text-muted);
  margin-bottom: var(--sd-space-2);
}
.sd-otp-resend button {
  background: none; border: none;
  color: var(--sd-primary);
  font-weight: var(--sd-weight-bold);
  font-size: var(--sd-text-sm);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.sd-otp-resend button:disabled { color: var(--sd-text-muted); cursor: default; font-weight: var(--sd-weight-medium); }

/* Masked destination pill */
.sd-otp-dest {
  display: inline-flex;
  align-items: center;
  gap: var(--sd-space-2);
  background: var(--sd-primary-light);
  color: var(--sd-primary);
  font-size: var(--sd-text-sm);
  font-weight: var(--sd-weight-semibold);
  border-radius: var(--sd-radius-full);
  padding: var(--sd-space-1) var(--sd-space-3);
}

/* ── Password strength meter (signup) ───────────────────────── */
.sd-pw-meter {
  display: flex;
  gap: var(--sd-space-2);
  margin: calc(var(--sd-space-2) * -1) var(--sd-space-1) var(--sd-space-4);
}
.sd-pw-meter__bar {
  flex: 1; height: 4px;
  border-radius: var(--sd-radius-full);
  background: var(--sd-border);
  transition: background var(--sd-duration-base) var(--sd-ease);
}
.sd-pw-meter__bar.lvl-1 { background: var(--sd-danger); }
.sd-pw-meter__bar.lvl-2 { background: var(--sd-warning); }
.sd-pw-meter__bar.lvl-3 { background: var(--sd-success); }

/* ── Steps indicator (signup) ───────────────────────────────── */
.sd-mlogin-progress {
  display: flex;
  gap: var(--sd-space-2);
  margin-bottom: var(--sd-space-6);
}
.sd-mlogin-progress__dot {
  flex: 1; height: 4px;
  border-radius: var(--sd-radius-full);
  background: var(--sd-border);
}
.sd-mlogin-progress__dot.active { background: var(--sd-primary); }

/* ── Desktop: phone-width centered card ─────────────────────── */
@media (min-width: 560px) {
  .sd-mlogin-sheet {
    border-radius: 28px;
    margin-bottom: var(--sd-space-10);
    flex: 0 1 auto;
  }
  .sd-mlogin-body { justify-content: center; }
  .sd-mlogin-top  { padding-top: var(--sd-space-10); }
}

/* ============================================================
   Sadora Auth — branded split layout
   Append to the END of sadora-auth.css.
   Adds the desktop two-pane (brand + form) layout while leaving
   the existing mobile sheet untouched. Used by login, forgot,
   reset, verify, etc. — just wrap the page in:

     <div class="sd-mlogin-layout">
       <aside class="sd-mlogin-brand"> … </aside>
       <div class="sd-mlogin-panel"> …logo + sheet… </div>
     </div>
   ============================================================ */

/* ── Layout shell (mobile = column, desktop = split row) ────── */
.sd-mlogin-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.sd-mlogin-panel {
  position: relative;     /* anchors the absolute back-button */
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Brand panel hidden by default (mobile/tablet) */
.sd-mlogin-brand { display: none; }

/* ══ TABLET: centre the card (560–991px) ═════════════════════ */
@media (min-width: 560px) and (max-width: 991.98px) {
  .sd-mlogin-panel { justify-content: center; }
  .sd-mlogin-sheet {
    flex: 0 1 auto;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    max-width: 420px;
    margin: 0 auto var(--sd-space-10);
  }
  .sd-mlogin-top { padding-top: var(--sd-space-10); }
}

/* ══ DESKTOP: branded split (≥992px) ═════════════════════════ */
@media (min-width: 992px) {
  .sd-mlogin-layout { flex-direction: row; }

  /* brand side */
  .sd-mlogin-brand {
    position: relative;
    display: flex;
    flex: 1.05 1 0;
    align-items: center;
    justify-content: center;
    padding: var(--sd-space-12);
    overflow: hidden;
    color: #fff;
    isolation: isolate;
  }
  .sd-mlogin-brand__bg {
    position: absolute; inset: 0; z-index: -1;
    background:
      radial-gradient(120% 90% at 18% 12%, rgba(255,255,255,0.20), transparent 42%),
      radial-gradient(120% 90% at 88% 8%, color-mix(in srgb, var(--sd-secondary, var(--sd-primary)) 55%, transparent), transparent 50%),
      linear-gradient(155deg,
        color-mix(in srgb, var(--sd-primary) 92%, #000),
        var(--sd-primary) 48%,
        color-mix(in srgb, var(--sd-primary) 72%, #000));
  }
  .sd-mlogin-brand__bg::after {
    content: '';
    position: absolute;
    right: -120px; bottom: -140px;
    width: 360px; height: 360px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
  }
  .sd-mlogin-brand__inner { max-width: 380px; width: 100%; }
  .sd-mlogin-brand__mark {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-bottom: var(--sd-space-6);
    backdrop-filter: blur(2px);
  }
  .sd-mlogin-brand__img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .sd-mlogin-brand__fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: var(--sd-weight-bold); font-size: var(--sd-text-xl);
  }
  .sd-mlogin-brand__name {
    font-size: var(--sd-text-2xl);
    font-weight: var(--sd-weight-bold);
    letter-spacing: -0.01em;
    margin: 0 0 var(--sd-space-3);
  }
  .sd-mlogin-brand__tag {
    font-size: var(--sd-text-md);
    line-height: 1.5;
    color: rgba(255,255,255,0.86);
    margin: 0 0 var(--sd-space-8);
    max-width: 34ch;
  }
  .sd-mlogin-brand__features {
    list-style: none; padding: 0; margin: 0 0 var(--sd-space-8);
    display: flex; flex-direction: column; gap: var(--sd-space-4);
  }
  .sd-mlogin-brand__features li {
    display: flex; align-items: center; gap: var(--sd-space-3);
    font-size: var(--sd-text-sm);
    color: rgba(255,255,255,0.92);
  }
  .sd-mlogin-brand__tick {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
  }
  .sd-mlogin-brand__trust {
    display: inline-flex; align-items: center; gap: var(--sd-space-2);
    font-size: var(--sd-text-xs);
    color: rgba(255,255,255,0.78);
    padding: var(--sd-space-2) var(--sd-space-3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--sd-radius-full, 999px);
    background: rgba(255,255,255,0.08);
  }

  /* form side */
  .sd-mlogin-panel {
    flex: 1 1 0;
    background: var(--sd-surface);
    align-items: center;
    justify-content: center;
    padding: var(--sd-space-8);
  }
  .sd-mlogin-top { display: none; }   /* identity lives in the brand panel */
  .sd-mlogin-sheet {
    flex: 0 1 auto;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: 380px;
    margin: 0;
  }
}