/* ============================================================
   MEAXTIME — shared AUTH design system  (single source of truth)
   Used by the split brand-panel auth screens that extend
   `layouts/base_auth_mx.html`: login (two_factor/_base.html) and
   signup (landing_register.html).

   100% MX-UI — atoms come from django-cotton (<c-mx.button/alert/…>)
   + the canonical .mx-* classes (mx-ui.css). This file only holds the
   bespoke split-auth COMPOSITION (brand panel + auth card + form
   rhythm) and self-contains its tokens on the `.mx-auth` scope so the
   canonical Inter/#696cff values win regardless of load order.
   Load order in the base: tokens.css → mx-ui.css → THIS.
   ============================================================ */

/* reset the browser's default 8px body margin (Sneat's core.css used to
   provide it) so the full-viewport auth layout isn't framed by a gap. */
html:has(.mx-auth), body:has(.mx-auth) { margin: 0; padding: 0; }

.mx-auth {
  --bg:#f8fafc;
  --surface:#fff;
  --surface-2:#f8fafc;
  --line:rgba(15,23,42,.08);
  --line-strong:rgba(15,23,42,.14);
  --ink:#0f172a;
  --ink-soft:#334155;
  --muted:#64748b;
  --muted-2:#94a3b8;
  --brand:#696cff;
  --brand-deep:#5457e0;
  /* MX-UI "Comfy" density — bigger controls (default is 32/36/40) */
  --mx-h-sm:36px; --mx-h-md:40px; --mx-h-lg:44px;
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(360px,50%) minmax(0,50%);
  background:var(--bg);
  color:var(--ink);
  font-family:"Public Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  font-size:15px;
  line-height:1.5;
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.mx-auth *{box-sizing:border-box;}
html[data-bs-theme="dark"] .mx-auth{
  --bg:#0a0b14; --surface:rgba(255,255,255,.026); --surface-2:rgba(255,255,255,.05);
  --line:rgba(180,185,255,.1); --line-strong:rgba(180,185,255,.18);
  --ink:#f1f3fb; --ink-soft:#c7cce0; --muted:#8b91ac; --muted-2:#646a85;
}

/* ---- brand panel (bespoke split-auth composition) ---- */
.mx-auth__brand{
  position:relative;
  min-width:0;
  min-height:100vh;
  padding:52px;
  display:flex;
  flex-direction:column;
  color:#fff;
  overflow:hidden;
  background:
    radial-gradient(42rem 24rem at 50% 120%, rgba(255,255,255,.16), transparent 70%),
    radial-gradient(30rem 16rem at 18% 0%, rgba(255,255,255,.12), transparent 72%),
    linear-gradient(135deg,#6c63ff 0%,#5147e6 48%,#362f9f 100%);
}
.mx-auth__brand::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 42%),
    radial-gradient(24rem 16rem at 82% 112%, rgba(255,75,62,.16), transparent 72%);
}
.mx-auth__brand>*{position:relative;z-index:1;}
.mx-auth__brand-link{align-self:flex-start;width:fit-content;line-height:0;border-radius:8px;transition:opacity .2s ease;}
.mx-auth__brand-link:hover{opacity:.82;}
.mx-auth__brand-link:focus-visible{outline:2px solid rgba(255,255,255,.85);outline-offset:4px;}
.mx-auth__brand-logo{display:block;width:121px;max-width:121px;height:42px;object-fit:contain;filter:drop-shadow(0 1px 3px rgba(15,23,42,.28));}
.mx-auth__brand-copy{margin-top:auto;}
.mx-auth__brand-copy h1{margin:0 0 18px;max-width:16ch;color:#fff;font-size:36px;line-height:1.14;font-weight:700;letter-spacing:-.03em;}
.mx-auth__brand-copy p{margin:0 0 34px;max-width:35ch;color:rgba(255,255,255,.78);font-size:16px;line-height:1.7;}
.mx-auth__brand-list{margin:0;padding:0;display:grid;gap:17px;list-style:none;}
.mx-auth__brand-list li{display:flex;align-items:flex-start;gap:12px;color:rgba(255,255,255,.92);font-size:15px;line-height:1.4;}
.mx-auth__brand-list .tick{flex:0 0 auto;width:18px;height:18px;margin-top:2px;border-radius:50%;display:grid;place-items:center;background:#fff;color:var(--brand);font-size:10px;font-weight:800;}
.mx-auth__brand-footer{margin-top:auto;padding-top:22px;border-top:1px solid rgba(255,255,255,.16);display:flex;flex-wrap:wrap;gap:10px 20px;color:rgba(255,255,255,.9);font-size:13.5px;}
.mx-auth__reassure{display:inline-flex;align-items:center;gap:8px;}
.mx-auth__reassure .ck{width:19px;height:19px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.2);color:#fff;flex:0 0 auto;}

/* ---- form side ---- */
.mx-auth__main{
  position:relative;
  min-width:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:42px 24px;
  overflow:auto;
}
.mx-auth__card{
  width:100%;
  max-width:520px;
  padding:40px;
  background:var(--surface);
  border-radius:var(--mx-radius-lg);
  box-shadow:0 12px 28px -24px rgba(15,23,42,.35);
}
.mx-auth__logo{display:flex;justify-content:center;margin-bottom:22px;}
.mx-auth__logo img{height:55px;width:auto;}
.mx-auth__title{margin:0 0 6px;color:var(--ink);font-size:26px;font-weight:700;letter-spacing:-.025em;}
.mx-auth__subtitle{margin:0 0 26px;color:var(--muted);font-size:15px;line-height:1.5;}
.mx-auth .mx-link{color:var(--brand);text-decoration:none;font-weight:500;font-size:14px;}
.mx-auth .mx-link:hover{color:var(--brand-deep);}

/* vertical rhythm helpers (replace Bootstrap mb-* utilities) */
.mx-auth__aux{margin:2px 0;}
.mx-auth__sep{margin:8px 0;}
.mx-auth__turnstile{display:flex;flex-direction:column;gap:6px;align-items:center;}

/* auth is a spacious surface — bump text above the app's dense default */
.mx-auth .mx-label{display:block;margin-bottom:6px;}
.mx-auth .mx-input{font-size:15px;}
.mx-auth .mx-btn{font-size:15px;font-weight:600;}
/* CTA one step above the 40px inputs (Comfy --mx-h-lg), not an 8px jump */
.mx-auth .mx-btn--block{height:44px;}
.mx-auth .mx-btn svg{flex:0 0 auto;width:18px;height:18px;}
.mx-auth .mx-input-affix svg{width:18px;height:18px;}

/* footer + legal */
.mx-auth__footer{margin:18px 0 0;text-align:center;color:var(--muted);font-size:15px;}
.mx-auth__legal{width:100%;max-width:520px;margin:34px auto 0;display:flex;justify-content:center;align-items:center;gap:18px;color:var(--muted);font-size:13px;}
.mx-auth__legal a{color:var(--muted);font-weight:500;text-decoration:none;}
.mx-auth__legal a:hover{color:var(--ink-soft);}
.mx-auth__legal i{width:3px;height:3px;border-radius:50%;background:var(--muted-2);opacity:.7;}

/* ---- bespoke OTP (two-step) input (login token step) ---- */
.mx-auth .otp-boxes{
  --gap:1.4rem;
  font-family:"SFMono-Regular",Menlo,Consolas,monospace;
  font-size:2rem;
  letter-spacing:var(--gap);
  text-align:center;
  width:calc((1ch + var(--gap)) * 6);
  max-width:100%;
  color:var(--ink);
  border:none;
  border-bottom:2px solid var(--line-strong);
  background:transparent;
  background-image:
    linear-gradient(to right, var(--line-strong) 1px, transparent 1px) 16.6667% 100%,
    linear-gradient(to right, var(--line-strong) 1px, transparent 1px) 33.3333% 100%,
    linear-gradient(to right, var(--line-strong) 1px, transparent 1px) 50%      100%,
    linear-gradient(to right, var(--line-strong) 1px, transparent 1px) 66.6667% 100%,
    linear-gradient(to right, var(--line-strong) 1px, transparent 1px) 83.3333% 100%;
  background-size:100% 100%;
  background-repeat:no-repeat;
  display:block;
}
.mx-auth .otp-boxes:focus{outline:none;border-bottom-color:var(--brand);}

/* ============================================================
   Centered UTILITY pages (base_site_mx.html): error pages, password
   reset, legal/flatpages, email confirmations, signup success. No brand
   panel — a single centered card / prose column. Uses canonical MX-UI
   tokens for type, surfaces, colors, spacing, and controls.
   ============================================================ */
.mx-page{
  --bg:var(--mx-bg);
  --surface:var(--mx-surface);
  --line:var(--mx-line);
  --line-strong:var(--mx-line-strong);
  --ink:var(--mx-ink);
  --ink-soft:var(--mx-ink-soft);
  --muted:var(--mx-muted);
  --muted-2:var(--mx-muted-2);
  --brand:var(--mx-brand);
  --brand-deep:var(--mx-brand-deep);
  --mx-h-sm:36px; --mx-h-md:40px; --mx-h-lg:44px;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--mx-font);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.mx-page *{box-sizing:border-box;}
html[data-bs-theme="dark"] .mx-page{
  --bg:#0a0b14; --surface:rgba(255,255,255,.026);
  --line:rgba(180,185,255,.1); --line-strong:rgba(180,185,255,.18);
  --ink:#f1f3fb; --ink-soft:#c7cce0; --muted:#8b91ac; --muted-2:#646a85;
}
html:has(.mx-page), body:has(.mx-page){margin:0;padding:0;}
.mx-page__topbar{width:100%;min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:var(--mx-gap-4);padding:18px 24px;}
.mx-page__brand{display:inline-flex;align-items:center;flex:0 0 auto;text-decoration:none;}
.mx-page__brand-logo{display:block;width:128px;height:auto;object-fit:contain;}
.mx-page__brand-logo--dark{display:none;}
:root[data-theme="dark"] .mx-page__brand-logo--light,
html[data-bs-theme="dark"] .mx-page__brand-logo--light{display:none;}
:root[data-theme="dark"] .mx-page__brand-logo--dark,
html[data-bs-theme="dark"] .mx-page__brand-logo--dark{display:block;}
.mx-page__main{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 20px;}
/* long-form prose (legal pages) is tall — align to top so it never clips */
.mx-page__main:has(.mx-page__prose){justify-content:flex-start;}
.mx-page__card{width:100%;max-width:440px;background:var(--surface);border-radius:var(--mx-radius-lg);box-shadow:0 12px 28px -24px rgba(15,23,42,.35);padding:40px;}
.mx-page__logo{display:flex;justify-content:center;margin-bottom:22px;}
.mx-page__logo img{height:44px;width:auto;}
.mx-page__title{margin:0 0 6px;color:var(--ink);font-size:24px;font-weight:700;letter-spacing:-.02em;text-align:center;}
.mx-page__subtitle{margin:0 0 24px;color:var(--muted);font-size:15px;line-height:1.55;text-align:center;}
.mx-page .mx-label{display:block;margin-bottom:6px;}
.mx-page .mx-input{font-size:15px;}
.mx-page .mx-btn{font-size:15px;font-weight:600;}
.mx-page .mx-btn--block{height:44px;}
.mx-page .mx-input-affix svg{width:18px;height:18px;}
.mx-page .mx-link{color:var(--brand);text-decoration:none;font-weight:600;}
.mx-page .mx-link:hover{color:var(--brand-deep);}

/* error / status pages (403/404/500, confirmations, success) */
.mx-page__status{text-align:center;max-width:520px;display:flex;flex-direction:column;align-items:center;}
.mx-page__status-code{font-size:96px;line-height:1;font-weight:800;letter-spacing:0;background:linear-gradient(135deg,var(--brand),var(--brand-deep));-webkit-background-clip:text;background-clip:text;color:transparent;margin:0 0 8px;}
.mx-page__status-icon{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;margin:0 0 18px;background:color-mix(in srgb,var(--brand) 10%,transparent);color:var(--brand);}
.mx-page__status-icon svg{width:30px;height:30px;}
.mx-page__status-icon--danger{background:rgba(239,68,68,.12);color:#ef4444;}
.mx-page__status-icon--success{background:rgba(34,197,94,.14);color:#16a34a;}
.mx-page__status h1{margin:0 0 8px;font-size:22px;font-weight:700;letter-spacing:0;color:var(--ink);}
.mx-page__status p{margin:0 0 26px;color:var(--muted);font-size:15px;line-height:1.6;max-width:42ch;}

/* legal / long-form prose (terms, privacy, flatpages) */
.mx-page__prose{width:100%;max-width:760px;margin:0 auto;padding:8px 4px 24px;color:var(--ink-soft);font-size:15.5px;line-height:1.7;}
.mx-page__prose h1{font-size:30px;font-weight:700;letter-spacing:-.02em;color:var(--ink);margin:0 0 8px;}
.mx-page__prose h2{font-size:20px;font-weight:700;letter-spacing:-.01em;color:var(--ink);margin:32px 0 10px;}
.mx-page__prose h3{font-size:16px;font-weight:600;color:var(--ink);margin:22px 0 8px;}
.mx-page__prose p,.mx-page__prose li{color:var(--ink-soft);}
.mx-page__prose a{color:var(--brand);text-decoration:none;font-weight:500;}
.mx-page__prose a:hover{text-decoration:underline;}
.mx-page__prose ul,.mx-page__prose ol{padding-left:22px;margin:0 0 16px;}
.mx-page__prose li{margin:4px 0;}
.mx-page__legal{padding:20px;text-align:center;color:var(--muted);font-size:13px;}
.mx-page__legal a{color:var(--muted);text-decoration:none;}
.mx-page__legal a:hover{color:var(--ink-soft);}

@media (max-width:560px){
  .mx-page__topbar{min-height:68px;padding:16px 20px;}
  .mx-page__brand-logo{width:116px;}
  .mx-page__card{max-width:440px;padding:28px 20px;background:transparent;box-shadow:none;}
  .mx-page__status-code{font-size:72px;}
}

/* ---- responsive ---- */
@media (max-width:1000px){
  .mx-auth{grid-template-columns:minmax(0,1fr);overflow:auto;}
  .mx-auth__brand{display:none;}
  .mx-auth__main{min-height:100vh;padding:28px 16px;}
}
@media (max-width:560px){
  .mx-auth__card{max-width:440px;padding:20px 4px;background:transparent;box-shadow:none;}
  .mx-auth__legal{flex-wrap:wrap;gap:8px 14px;margin-top:24px;font-size:12.5px;}
  .mx-auth__legal span,
  .mx-auth__legal a{white-space:nowrap;}
  .mx-auth__legal > span{flex:1 0 100%;text-align:center;}
  .mx-auth__legal i:first-of-type{display:none;}
}
