/* =====================================================
   SeOMeter auth pages: login, register, forgot/reset password.
   One token set, light + dark, no forced-dark panels.
   Markup and behaviour live in PHP; colours live here.
===================================================== */

:root {
  
  --auth-page: #f5f8ff;
  --auth-panel: #eaf1ff;
  --auth-panel-2: #dce8ff;
  --auth-card: #ffffff;
  --auth-field: #f6f8fc;
  --auth-text: #0b0f19;
  --auth-muted: #5b6b82;
  --auth-border: #dbe3ef;
  --auth-border-strong: #c3cfe0;
  --auth-primary: #2563eb;
  --auth-primary-2: #1d4ed8;
  --auth-primary-soft: rgba(37, 99, 235, .10);
  --auth-success: #047857;
  --auth-success-bg: #ecfdf5;
  --auth-danger: #b91c1c;
  --auth-danger-bg: #fef2f2;
  --auth-info-bg: #eff6ff;
  --auth-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 60px -24px rgba(30, 58, 138, .28);
  --auth-ring: rgba(37, 99, 235, .28);
  --auth-social-bg: #ffffff;
  --auth-social-hover: #f3f6fc;
  --sm-public-header-height: 64px;
}
:root[data-theme="light"] {  }

:root[data-theme="dark"] {
  color-scheme: dark;
  --auth-page: #0b0f19;
  --auth-panel: #0f1730;
  --auth-panel-2: #14204a;
  --auth-card: #131a2b;
  --auth-field: #0e1424;
  --auth-text: #f1f5f9;
  --auth-muted: #9aa8bd;
  --auth-border: #243049;
  --auth-border-strong: #33415f;
  --auth-primary: #60a5fa;
  --auth-primary-2: #3b82f6;
  --auth-primary-soft: rgba(96, 165, 250, .14);
  --auth-success: #34d399;
  --auth-success-bg: rgba(16, 185, 129, .12);
  --auth-danger: #f87171;
  --auth-danger-bg: rgba(239, 68, 68, .12);
  --auth-info-bg: rgba(96, 165, 250, .10);
  --auth-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 28px 70px -28px rgba(0, 0, 0, .75);
  --auth-ring: rgba(96, 165, 250, .38);
  --auth-social-bg: #182036;
  --auth-social-hover: #1e2846;
}
@media (prefers-color-scheme: dark) {
  :is(:root:not([data-theme]), :root[data-theme-pref="system"]:not([data-theme="light"])) {
    color-scheme: dark;
    --auth-page: #0b0f19; --auth-panel: #0f1730; --auth-panel-2: #14204a; --auth-card: #131a2b; --auth-field: #0e1424;
    --auth-text: #f1f5f9; --auth-muted: #9aa8bd; --auth-border: #243049; --auth-border-strong: #33415f;
    --auth-primary: #60a5fa; --auth-primary-2: #3b82f6; --auth-primary-soft: rgba(96, 165, 250, .14);
    --auth-success: #34d399; --auth-success-bg: rgba(16, 185, 129, .12);
    --auth-danger: #f87171; --auth-danger-bg: rgba(239, 68, 68, .12); --auth-info-bg: rgba(96, 165, 250, .10);
    --auth-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 28px 70px -28px rgba(0, 0, 0, .75); --auth-ring: rgba(96, 165, 250, .38);
    --auth-social-bg: #182036; --auth-social-hover: #1e2846;
  }
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body.auth-split-page { width: 100%; max-width: 100%; overflow-x: hidden; }
.auth-split, .auth-split *, .auth-split *::before, .auth-split *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.auth-split h1, .auth-split h2, .auth-split p, .auth-split ul, .auth-split figure { margin: 0; padding: 0; }

body.auth-split-page {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  padding-top: var(--sm-public-header-height);
  background: var(--auth-page);
  color: var(--auth-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
html.is-leaving body.auth-split-page, body.is-leaving .auth-split { opacity: 0; transform: scale(.99); transition: opacity .3s ease, transform .3s ease; }

.auth-split a { color: var(--auth-primary); font-weight: 600; text-decoration: none; }
.auth-split a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-split :focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 2px; }
#sf-public-header { z-index: 1000; }
#sf-public-sidebar { z-index: 1002; }
#sf-public-sidebar-backdrop { z-index: 1001; }

/* ---------- layout ---------- */
.auth-split {
  flex: 1; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100vh - var(--sm-public-header-height));
  min-height: calc(100dvh - var(--sm-public-header-height));
}

/* ----- illustration panel ----- */
.auth-split .auth-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 28px;
  padding: clamp(32px, 5vw, 72px);
  background:
    radial-gradient(60% 50% at 85% 10%, var(--auth-primary-soft), transparent 70%),
    linear-gradient(160deg, var(--auth-panel) 0%, var(--auth-panel-2) 100%);
  border-right: 1px solid var(--auth-border);
  color: var(--auth-text);
}
.auth-split .auth-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--auth-border) 1px, transparent 1px), linear-gradient(90deg, var(--auth-border) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent 80%);
  mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent 80%);
}
.auth-split .hero-brand { display: inline-flex; }
.auth-split .hero-brand img { display: block; width: auto; height: 38px; max-width: 220px; object-fit: contain; }
.auth-split .hero-brand .logo-dark { display: none; }
:root[data-theme="dark"] .auth-split .hero-brand .logo-light { display: none; }
:root[data-theme="dark"] .auth-split .hero-brand .logo-dark { display: block; }

.auth-split .auth-hero h2 {
  font: 800 clamp(28px, 3vw, 40px)/1.14 "Manrope", "Inter", sans-serif;
  letter-spacing: -.03em; max-width: 480px; color: var(--auth-text);
}
.auth-split .auth-hero .lead { color: var(--auth-muted); font-size: 15px; max-width: 440px; }

.auth-split .auth-art { width: 100%; max-width: 520px; margin: 0; }
.auth-split .auth-art img {
  display: block; width: 100%; height: auto; max-height: min(46vh, 420px);
  object-fit: contain; object-position: left center;
}
.auth-split .auth-art.is-missing { display: none; }

.auth-split .hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.auth-split .hero-points li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--auth-card); border: 1px solid var(--auth-border);
  color: var(--auth-text); font-size: 13px; font-weight: 600;
}
.auth-split .hero-points i { color: var(--auth-primary); font-size: 12px; }

/* ----- form side ----- */
.auth-split .auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(20px, 4vw, 48px); }
.auth-split .auth-card {
  width: 100%; max-width: 440px;
  background: var(--auth-card); border: 1px solid var(--auth-border);
  border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--auth-shadow);
}
.auth-split .card-brand { display: none; text-align: center; margin-bottom: 16px; }
.auth-split .card-brand img, .auth-split .card-brand img.auth-logo { width: auto; max-width: 220px; height: 44px; object-fit: contain; }
.auth-split .card-brand .logo-light { display: inline-block; }
.auth-split .card-brand .logo-dark { display: none; }
:root[data-theme="dark"] .auth-split .card-brand .logo-light { display: none; }
:root[data-theme="dark"] .auth-split .card-brand .logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :is(:root:not([data-theme]), :root[data-theme-pref="system"]:not([data-theme="light"])) .auth-split .card-brand .logo-light,
  :is(:root:not([data-theme]), :root[data-theme-pref="system"]:not([data-theme="light"])) .auth-split .hero-brand .logo-light { display: none; }
  :is(:root:not([data-theme]), :root[data-theme-pref="system"]:not([data-theme="light"])) .auth-split .card-brand .logo-dark { display: inline-block; }
  :is(:root:not([data-theme]), :root[data-theme-pref="system"]:not([data-theme="light"])) .auth-split .hero-brand .logo-dark { display: block; }
}

.auth-split .brand { margin-bottom: 22px; text-align: left; }
.auth-split .brand h1 { font: 800 26px/1.2 "Manrope", "Inter", sans-serif; letter-spacing: -.03em; }
.auth-split .sub { color: var(--auth-muted); font-size: 14px; margin-top: 6px; }

/* ---------- alerts ---------- */
.auth-split .alert {
  padding: 11px 14px; border-radius: 12px; margin-bottom: 16px;
  font-size: 13px; font-weight: 600; line-height: 1.5; border: 1px solid transparent;
}
.auth-split .alert.error   { background: var(--auth-danger-bg);  color: var(--auth-danger);  border-color: color-mix(in srgb, var(--auth-danger) 30%, transparent); }
.auth-split .alert.success { background: var(--auth-success-bg); color: var(--auth-success); border-color: color-mix(in srgb, var(--auth-success) 30%, transparent); }
.auth-split .alert.info    { background: var(--auth-info-bg);    color: var(--auth-primary); border-color: color-mix(in srgb, var(--auth-primary) 30%, transparent); }
.auth-split .alert:empty, .auth-split .alert[hidden] { display: none; }
.auth-split .alert.shake, .auth-split .alert.authShake { animation: authShake .4s; }
.auth-split .status-msg { margin-top: 14px; }
.auth-split .status-msg:empty { display: none; }

/* ---------- form ---------- */
.auth-split .field { margin-bottom: 14px; }
.auth-split .field label { display: block; margin-bottom: 6px; color: var(--auth-text); font-size: 13px; font-weight: 600; }
.auth-split .input-wrap {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px;
  background: var(--auth-field); border: 1px solid var(--auth-border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-split .input-wrap:hover { border-color: var(--auth-border-strong); }
.auth-split .input-wrap:focus-within { border-color: var(--auth-primary); box-shadow: 0 0 0 4px var(--auth-ring); background: var(--auth-card); }
.auth-split .input-wrap > i.fa-solid, .auth-split .input-wrap > i.fa-regular { width: 16px; text-align: center; color: var(--auth-muted); font-size: 14px; }
.auth-split .input-wrap:focus-within > i.fa-solid { color: var(--auth-primary); }
.auth-split .input-wrap input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--auth-text); font: inherit; font-size: 15px; padding: 12px 0;
}
.auth-split .input-wrap input::placeholder { color: var(--auth-muted); opacity: .75; }
.auth-split .input-wrap input[readonly] { color: var(--auth-muted); }
.auth-split .input-wrap input:-webkit-autofill,
.auth-split .input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-text);
  -webkit-box-shadow: 0 0 0 1000px var(--auth-field) inset;
  caret-color: var(--auth-text);
  transition: background-color 99999s ease-in-out 0s;
}
.auth-split .toggle-pw { display: grid; place-items: center; width: 32px; height: 32px; margin-right: -6px; border: 0; border-radius: 8px; background: none; color: var(--auth-muted); cursor: pointer; }
.auth-split .toggle-pw:hover { color: var(--auth-primary); background: var(--auth-primary-soft); }

.auth-split .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; font-size: 13px; }
.auth-split .remember { display: inline-flex; align-items: center; gap: 8px; color: var(--auth-muted); font-weight: 500; cursor: pointer; }
.auth-split .remember input { width: 16px; height: 16px; accent-color: var(--auth-primary); }

.auth-split .strength { height: 4px; margin-top: 8px; border-radius: 4px; background: var(--auth-border); overflow: hidden; }
.auth-split .strength i { display: block; height: 100%; width: calc(var(--s, 0) * 25%); border-radius: 4px; background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981); background-size: 400% 100%; background-position: calc((var(--s, 0) - 1) * 33%) 0; transition: width .25s; }
.auth-split .strength-label { min-height: 16px; margin-top: 4px; color: var(--auth-muted); font-size: 12px; font-weight: 600; }

.auth-split .field-hint { margin-top: 7px; color: var(--auth-muted); font-size: 12px; line-height: 1.45; }
.auth-split .create-hint { text-align: center; }

/* ---------- buttons ---------- */
.auth-split .btn {
  width: 100%; min-height: 48px; padding: 12px 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.auth-split .btn:hover { text-decoration: none; }
.auth-split .btn:active { transform: translateY(1px); }
.auth-split .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.auth-split .btn-primary { background: var(--auth-primary-2); color: #fff; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .7); }
.auth-split .btn-primary:hover:not(:disabled) { background: var(--auth-primary); filter: brightness(1.06); }
:root[data-theme="dark"] .auth-split .btn-primary { background: #3b82f6; color: #06101f; }
.auth-split .btn-primary.is-done { background: #059669; color: #fff; box-shadow: none; }
.auth-split .create-account-btn:disabled { box-shadow: none; }

.auth-split .btn-outline { margin-top: 10px; background: var(--auth-social-bg); color: var(--auth-text); border-color: var(--auth-border-strong); font-weight: 600; }
.auth-split .btn-outline:hover:not(:disabled) { background: var(--auth-social-hover); border-color: var(--auth-primary); }
.auth-split .btn-outline > i { color: var(--auth-primary); }
.auth-split .btn-ghost { width: auto; min-height: 38px; padding: 8px 14px; background: transparent; color: var(--auth-muted); border-color: var(--auth-border); font-size: 13px; }
.auth-split .btn-danger { margin-top: 10px; background: var(--auth-danger-bg); color: var(--auth-danger); }

.auth-split .text-button { display: inline-flex; align-items: center; margin-top: 8px; padding: 4px 0; border: 0; background: transparent; color: var(--auth-primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-split .text-button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- social sign-in ---------- */
.auth-split .divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 14px; color: var(--auth-muted); font-size: 12px; font-weight: 600; }
.auth-split .divider::before, .auth-split .divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-border); }

/* Custom Google button. The real Google button is rendered transparent on top so the click still
   goes through Google's own flow, while the visible button follows the SeOMeter theme. */
.auth-split .google-wrap { position: relative; min-height: 48px; }
.auth-split .btn-google { margin: 0; pointer-events: none; }
.auth-split .btn-google .g-logo { width: 18px; height: 18px; flex: none; }
.auth-split .google-wrap:hover .btn-google { background: var(--auth-social-hover); border-color: var(--auth-primary); }
.auth-split .google-wrap:focus-within .btn-google { outline: 2px solid var(--auth-primary); outline-offset: 2px; }
.auth-split .google-overlay { position: absolute; inset: 0; overflow: hidden; border-radius: 12px; opacity: .001; z-index: 2; }
.auth-split .google-overlay > div, .auth-split .google-overlay iframe { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.auth-split .google-fallback { margin-top: 8px; color: var(--auth-muted); font-size: 12px; text-align: center; }
.auth-split .btn-passkey { margin-top: 10px; }

.auth-split .foot { margin-top: 22px; text-align: center; color: var(--auth-muted); font-size: 14px; font-weight: 500; }
.auth-split .trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 16px; color: var(--auth-muted); font-size: 12px; font-weight: 500; }
.auth-split .trust i { margin-right: 5px; color: var(--auth-success); }

/* ---------- register: email verify + OTP ---------- */
.auth-split .email-verify-row, .auth-split .otp-entry-row { display: flex; align-items: stretch; gap: 8px; }
.auth-split .email-verify-row .input-wrap, .auth-split .otp-entry-row .input-wrap { flex: 1 1 auto; min-width: 0; }
.auth-split .btn.verify-email-btn, .auth-split .btn.verify-code-btn {
  flex: 0 0 auto; width: auto; min-width: 112px; min-height: 48px; margin: 0; padding: 10px 14px;
  font-size: 13px; white-space: nowrap;
}
.auth-split .email-verified-note { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: var(--auth-success); font-size: 13px; font-weight: 700; }
.auth-split [hidden] { display: none !important; }
.auth-split .otp-field .input-wrap input { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; letter-spacing: .18em; }

/* ---------- single-column recovery pages ---------- */
.auth-split.auth-single { grid-template-columns: minmax(0, 1fr); align-items: center; }
.auth-split.auth-single .auth-panel { padding: clamp(16px, 4vw, 40px); }
.auth-split.auth-single .auth-card { max-width: 460px; }
.auth-split.auth-single .card-brand { display: block; }

@keyframes authShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes authCardIn { from { opacity: 0; transform: translateY(12px); } }
.auth-split .auth-card { animation: authCardIn .45s cubic-bezier(.2, .7, .3, 1) both; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-split .auth-hero { display: none; }
  .auth-split .card-brand { display: block; }
  .auth-split .auth-panel { align-items: flex-start; padding: 22px 14px 40px; }
  .auth-split .brand { text-align: center; }
}
@media (max-width: 640px) {
  :root { --sm-public-header-height: 58px; }
  .auth-split .auth-card { padding: 26px 20px; border-radius: 18px; }
  .auth-split .brand h1 { font-size: 23px; }
  .auth-split .email-verify-row, .auth-split .otp-entry-row { gap: 7px; }
  .auth-split .btn.verify-email-btn, .auth-split .btn.verify-code-btn { min-width: 96px; padding-inline: 10px; font-size: 12px; }
}
@media (max-width: 360px) {
  :root { --sm-public-header-height: 54px; }
  .auth-split .auth-card { padding: 22px 15px; }
  .auth-split .email-verify-row, .auth-split .otp-entry-row { flex-wrap: wrap; }
  .auth-split .btn.verify-email-btn, .auth-split .btn.verify-code-btn { width: 100%; }
}
@media (min-width: 961px) and (max-height: 720px) { .auth-split .hero-points { display: none; } .auth-split .auth-art img { max-height: 36vh; } }
@media (prefers-reduced-motion: reduce) {
  .auth-split, .auth-split *, .auth-split *::before, .auth-split *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* two-factor helper buttons on login */
.auth-split .tf-inline-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.auth-split .tf-inline-actions .btn { width: auto; margin-top: 0; }
