/* ============================================================================
   auth-volleo.css - shared design system for the five auth surfaces:
   login.html, register.html, forgot.html, verify-email.html, accept-invite.html

   Core tokens mirror web/src/pages/landing.astro so the auth pages read as
   the same product as the marketing page. Supports both dark (default) and
   warm-paper light mode toggled via html[data-theme="light"] in
   app-preferences.css (loaded after this sheet).

   LOAD-BEARING NAMES - added, removed or read by the page scripts, which are
   frozen by source-pinning tests. Never rename or remove hooks on:
     .loading      submit buttons (login, register, forgot, accept-invite)
     .open         #company-modal (login, register)
     .disabled     #resend-link (verify-email)
     .otp-inputs   querySelectorAll target (verify-email, forgot)
     .alert / .alert-error / .alert-success
                   #alert-box (forgot) - assigned with className =, wiping
                   any extra classes on the element
     .message-box / .error / .success / .info
                   #inviteMessage (accept-invite) - assigned with className =
     .loading-state / .invalid-state / .form-section / .google-invite-section
                   accept-invite state containers toggled via style.display / hidden
   ========================================================================= */

:root{
  /* Pinned core palette tokens (do not rename or alter #060A12 / #22D3EE) */
  --void:#060A12;
  --panel:rgba(18,26,38,.62);
  --raised:rgba(28,38,52,.72);
  --sunken:#070C15;
  --cyan:#22D3EE;
  --sky:#38BDF8;
  --ice:#F1F5F9;
  --steel:#94A3B8;
  --hair:rgba(34,211,238,.15);
  --line:rgba(148,163,184,.14);
  --danger:#F87171;
  --success:#34D399;
  --on-cyan:#04121a;
  --r-sm:10px;
  --r-md:14px;
  --r-lg:18px;
  --r-pill:999px;

  /* Extended atmospheric & glass tokens for the auth surface */
  --auth-card-bg:linear-gradient(165deg,rgba(16,25,40,.74) 0%,rgba(9,15,26,.86) 100%);
  --auth-card-border:rgba(148,163,184,.16);
  --auth-card-rim:linear-gradient(90deg,transparent 8%,rgba(34,211,238,.48) 50%,transparent 92%);
  --auth-card-shadow:0 28px 80px -20px rgba(2,6,14,.8),0 0 0 1px rgba(34,211,238,.05) inset;
  --auth-input-bg:rgba(6,11,20,.82);
  --auth-input-focus-bg:rgba(7,17,30,.94);
  --auth-input-border:rgba(148,163,184,.18);
  --auth-input-hover-border:rgba(34,211,238,.36);
  --auth-placeholder:#7C8DA6; /* 5.6:1 on #080D17 (passes WCAG AA) */
  --auth-focus-glow:0 0 0 4px rgba(34,211,238,.18),0 0 24px -4px rgba(34,211,238,.34);
  --auth-btn-bg:linear-gradient(135deg,#22D3EE 0%,#38BDF8 100%);
  --auth-btn-hover-bg:linear-gradient(135deg,#3EE0F7 0%,#56CCF9 100%);
  --auth-btn-shadow:0 12px 30px -10px rgba(34,211,238,.52),inset 0 1px 0 rgba(255,255,255,.38);
  --auth-btn-hover-shadow:0 16px 36px -10px rgba(34,211,238,.68),inset 0 1px 0 rgba(255,255,255,.46);
  --auth-brand-glow:drop-shadow(0 0 10px rgba(34,211,238,.42));
  --auth-selection:rgba(34,211,238,.26);
  --auth-error-bg:rgba(248,113,113,.09);
  --auth-error-border:rgba(248,113,113,.3);
  --auth-error-ring:rgba(248,113,113,.16);
  --auth-success-bg:rgba(52,211,153,.09);
  --auth-success-border:rgba(52,211,153,.3);
  --auth-info-bg:rgba(34,211,238,.08);
  --auth-surface-subtle:rgba(12,20,34,.72);
  --auth-main-glow:
    radial-gradient(64% 48% at 18% 12%,rgba(34,211,238,.09),transparent 65%),
    radial-gradient(56% 46% at 86% 90%,rgba(56,189,248,.07),transparent 68%);
  /* Keep the artwork stage obsidian so #060A12 renders melt seamlessly in both themes */
  --auth-stage-bg:#060A12;
  --auth-stage-divider:rgba(34,211,238,.14);
  --auth-modal-bg:linear-gradient(165deg,rgba(16,25,40,.92) 0%,rgba(9,15,26,.96) 100%);
  --auth-modal-backdrop:rgba(4,8,15,.78);
  color-scheme:dark;
}

/* Warm-paper light theme paired with an obsidian showcase stage (matching landing.astro).
   app-preferences.css loads after this file and sets --void, --ice, --steel, --cyan, etc. */
html[data-theme="light"]{
  --auth-card-bg:rgba(251,250,247,.94);
  --auth-card-border:rgba(35,36,31,.11);
  --auth-card-rim:linear-gradient(90deg,transparent 12%,rgba(14,116,144,.32) 50%,transparent 88%);
  --auth-card-shadow:0 1px 2px rgba(35,36,31,.04),0 24px 56px -20px rgba(35,36,31,.16);
  --auth-input-bg:#FDFCFA;
  --auth-input-focus-bg:#FFFFFF;
  --auth-input-border:rgba(35,36,31,.14);
  --auth-input-hover-border:rgba(14,116,144,.42);
  --auth-placeholder:#6B6960;
  --auth-focus-glow:inset 0 0 0 1px var(--cyan),0 0 0 4px rgba(14,116,144,.16),0 6px 18px -6px rgba(14,116,144,.2);
  --auth-btn-bg:var(--cyan);
  --auth-btn-hover-bg:var(--sky);
  --auth-btn-shadow:0 10px 24px -10px rgba(14,116,144,.48),inset 0 1px 0 rgba(255,255,255,.22);
  --auth-btn-hover-shadow:0 14px 28px -10px rgba(11,100,120,.54),inset 0 1px 0 rgba(255,255,255,.28);
  --auth-brand-glow:none;
  --auth-selection:rgba(14,116,144,.18);
  --auth-error-bg:rgba(180,35,24,.07);
  --auth-error-border:rgba(180,35,24,.28);
  --auth-error-ring:rgba(180,35,24,.16);
  --auth-success-bg:rgba(4,120,87,.08);
  --auth-success-border:rgba(4,120,87,.28);
  --auth-info-bg:rgba(14,116,144,.08);
  --auth-surface-subtle:#F2F0EA;
  --auth-main-glow:
    radial-gradient(62% 48% at 14% 10%,rgba(14,116,144,.08),transparent 64%),
    radial-gradient(54% 44% at 88% 92%,rgba(11,100,120,.05),transparent 66%);
  --auth-stage-bg:#060A12;
  --auth-stage-divider:rgba(35,36,31,.12);
  --auth-modal-bg:rgba(251,250,247,.97);
  --auth-modal-backdrop:rgba(35,36,31,.42);
  color-scheme:light;
}

/* ---------- reset + page ground ---------- */

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  background:var(--void);
  color:var(--ice);
  font-family:Geist,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:16px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:clip;
  transition:background-color .2s ease,color .2s ease;
}

::selection{background:var(--auth-selection);color:var(--ice)}

h1,h2,h3,.display{
  font-family:"Space Grotesk",system-ui,sans-serif;
  letter-spacing:-.03em;
  margin:0;
  line-height:1.12;
  text-wrap:balance;
}

a{
  color:var(--cyan);
  text-decoration:none;
  text-underline-offset:3px;
  text-decoration-thickness:1.5px;
  transition:color .16s ease;
}
a:hover{text-decoration:underline}

/* Focus is never removed, only restyled. Clears WCAG 2.2 SC 2.4.11 / 2.4.13
   in both dark (#22D3EE on #060A12) and light (#0E7490 on #FBFAF7) themes. */
:focus-visible{outline:2px solid var(--cyan);outline-offset:3px;border-radius:var(--r-sm)}

/* ---------- shell: asymmetric split, form left / floating 3D stage right ----------
   <main> stays first in DOM order so keyboard, screen-reader and mobile users
   always reach the form first without scrolling past decorative artwork. */

.auth-shell{
  display:grid;
  grid-template-columns:minmax(0,48fr) minmax(0,52fr);
  min-height:100dvh; /* avoids iOS Safari 100vh address-bar jump */
  background:var(--void);
  overflow-x:clip;
}

.auth-main{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding-inline:clamp(20px,4vw,56px);
  padding-block:clamp(32px,5vw,64px);
  background:var(--auth-main-glow),var(--void);
}

.auth-card{
  position:relative;
  z-index:1;
  width:100%;
  max-width:456px;
  padding:clamp(26px,3.2vw,38px);
  background:var(--auth-card-bg);
  border:1px solid var(--auth-card-border);
  border-radius:22px;
  backdrop-filter:blur(20px) saturate(135%);
  -webkit-backdrop-filter:blur(20px) saturate(135%);
  box-shadow:var(--auth-card-shadow);
}

/* Razor-thin specular cyan rim along the top edge of the glass card */
.auth-card::before{
  content:"";
  position:absolute;
  top:-1px;left:10%;right:10%;
  height:1px;
  background:var(--auth-card-rim);
  pointer-events:none;
}

/* ---------- floating 3D artwork stage + CSS aurora ----------
   isolation:isolate keeps mix-blend-mode:lighten scoped to the aside while
   letting .auth-visual blend directly over the drifting aurora orbs behind it.
   Do not add z-index or transform to .auth-stage or it traps the blend mode. */

.auth-aside{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(24px,3.5vw,52px);
  background:var(--auth-stage-bg);
}

/* Luminous seam separating form workspace from the artwork stage */
.auth-aside::before{
  content:"";
  position:absolute;
  top:8%;bottom:8%;left:0;
  width:1px;
  background:linear-gradient(180deg,transparent 0%,rgba(34,211,238,.22) 28%,rgba(56,189,248,.16) 72%,transparent 100%);
  pointer-events:none;
}
html[data-theme="light"] .auth-aside::before{top:0;bottom:0;background:var(--auth-stage-divider)}

.auth-aurora{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.auth-aurora-orb{position:absolute;border-radius:50%;will-change:transform,opacity}

.auth-aurora-orb--primary{
  top:4%;left:8%;width:78%;aspect-ratio:1;
  background:radial-gradient(circle,rgba(34,211,238,.26) 0%,rgba(56,189,248,.11) 42%,transparent 72%);
  filter:blur(64px);
  animation:auth-aurora-drift-a 18s ease-in-out infinite alternate;
}
.auth-aurora-orb--secondary{
  right:4%;bottom:2%;width:72%;aspect-ratio:1;
  background:radial-gradient(circle,rgba(56,189,248,.22) 0%,rgba(14,116,144,.14) 44%,transparent 74%);
  filter:blur(72px);
  animation:auth-aurora-drift-b 23s ease-in-out infinite alternate;
}
.auth-aurora-orb--core{
  top:18%;left:22%;width:56%;aspect-ratio:1;
  background:radial-gradient(circle,rgba(34,211,238,.22) 0%,rgba(34,211,238,.06) 48%,transparent 74%);
  filter:blur(42px);
  animation:auth-aurora-breathe 11s ease-in-out infinite alternate;
}

.auth-stage{position:relative;display:grid;place-items:center;width:100%;max-width:520px}

/* Concentric orbital light ring echoing the landing page's 3D halo */
.auth-halo{
  position:absolute;
  top:10%;width:min(76%,390px);aspect-ratio:1;
  border-radius:50%;
  border:1px solid rgba(34,211,238,.11);
  box-shadow:0 0 60px rgba(34,211,238,.08);
  pointer-events:none;
  animation:auth-halo-spin 42s linear infinite;
}
.auth-halo::before{
  content:"";
  position:absolute;inset:-1px;border-radius:50%;
  background:conic-gradient(from 0deg,transparent 0deg,rgba(34,211,238,.42) 42deg,transparent 96deg,transparent 200deg,rgba(56,189,248,.26) 244deg,transparent 296deg);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 1.5px),#000 calc(100% - 1px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 1.5px),#000 calc(100% - 1px));
}

/* Portrait 4:5 (1024x1280) renders drawn on #060A12 with subject in upper two-thirds.
   The elliptical radial mask guarantees all four edges fade to 0% before the frame
   boundary, so the artwork floats freely with no box, card or rectangular seam. */
.auth-visual{
  position:relative;
  display:block;
  width:min(100%,490px,64dvh);
  aspect-ratio:4/5;
  height:auto;
  object-fit:cover;
  object-position:50% 28%;
  border:0;border-radius:0;box-shadow:none;background:transparent;
  pointer-events:none;
  user-select:none;
  -webkit-mask-image:radial-gradient(ellipse 49% 48% at 50% 48%,#000 62%,rgba(0,0,0,.86) 76%,rgba(0,0,0,.38) 90%,transparent 100%);
  mask-image:radial-gradient(ellipse 49% 48% at 50% 48%,#000 62%,rgba(0,0,0,.86) 76%,rgba(0,0,0,.38) 90%,transparent 100%);
  animation:auth-float 7.5s ease-in-out infinite;
}

/* Dark theme: #060A12 image backdrop yields to the aurora glow behind it */
:root:not([data-theme="light"]) .auth-visual,
html[data-theme="dark"] .auth-visual{mix-blend-mode:lighten}

@keyframes auth-aurora-drift-a{
  0%{transform:translate3d(-4%,-3%,0) scale(1)}
  50%{transform:translate3d(6%,4%,0) scale(1.08)}
  100%{transform:translate3d(-2%,7%,0) scale(.96)}
}
@keyframes auth-aurora-drift-b{
  0%{transform:translate3d(4%,4%,0) scale(1.04)}
  50%{transform:translate3d(-6%,-4%,0) scale(.95)}
  100%{transform:translate3d(2%,-6%,0) scale(1.07)}
}
@keyframes auth-aurora-breathe{
  0%{opacity:.72;transform:scale(.95)}
  100%{opacity:1;transform:scale(1.08)}
}
@keyframes auth-float{
  0%,100%{transform:translate3d(0,0,0)}
  50%{transform:translate3d(0,-11px,0)}
}
@keyframes auth-halo-spin{to{transform:rotate(360deg)}}

/* ---------- navigation + brand block ---------- */

/* Back link forms its own line above the brand on recovery screens */
.auth-back{
  display:flex;width:fit-content;align-items:center;gap:8px;
  margin-bottom:18px;
  color:var(--steel);font-size:.84rem;font-weight:500;
  transition:color .16s ease;
}
.auth-back svg{transition:transform .16s ease}
.auth-back:hover{color:var(--ice);text-decoration:none}
.auth-back:hover svg{transform:translateX(-2px)}

.auth-brand{
  position:relative;z-index:1;
  display:inline-flex;align-items:center;gap:.6rem;
  margin-bottom:24px;
  font-family:"Space Grotesk",system-ui,sans-serif;
  font-weight:700;font-size:1.15rem;letter-spacing:-.02em;
  color:var(--ice);
}
.auth-brand:hover{text-decoration:none;color:var(--cyan)}
.auth-brand svg,.auth-brand img{width:26px;height:26px;flex:0 0 auto;color:var(--cyan);filter:var(--auth-brand-glow)}

.auth-eyebrow{
  display:inline-flex;align-items:center;gap:.4rem;
  margin-bottom:12px;
  font-size:.72rem;font-weight:500;letter-spacing:.12em;text-transform:uppercase;
  color:var(--cyan);background:var(--auth-info-bg);
  border:1px solid var(--hair);border-radius:var(--r-pill);
  padding-inline:12px;padding-block:5px;
}

/* ---------- card header ---------- */

.auth-head{margin-bottom:26px}
.auth-head h1{font-size:clamp(1.52rem,2.3vw,1.92rem);margin-bottom:8px}
.auth-head p{color:var(--steel);margin:0;font-size:.94rem;line-height:1.52;overflow-wrap:anywhere}
.auth-head strong{color:var(--cyan);font-weight:600}

/* ---------- form primitives ---------- */

/* Compact 2-column row for First + Last name on register.astro */
.auth-name-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}

.input-group{margin-bottom:16px}

.input-group label,.auth-label{
  display:block;margin-bottom:7px;
  font-size:.82rem;font-weight:500;color:var(--ice);letter-spacing:.01em;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="tel"],
.auth-input{
  width:100%;min-height:48px; /* >= 44px touch target */
  padding-inline:15px;padding-block:12px;
  background:var(--auth-input-bg);
  border:1px solid var(--auth-input-border);
  border-radius:var(--r-md);
  color:var(--ice);caret-color:var(--cyan);
  font-family:inherit;font-size:.96rem;
  transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease;
}

.input-group input::placeholder,.auth-input::placeholder{color:var(--auth-placeholder);opacity:1}
.input-group input:hover,.auth-input:hover{border-color:var(--auth-input-hover-border)}

/* Clear cyan focus ring + soft halo; inset ring preserves focus visibility
   in light mode where app-preferences.css pins input border-color. */
.input-group input:focus,.auth-input:focus{
  outline:2px solid var(--cyan);outline-offset:2px;
  border-color:var(--cyan);background:var(--auth-input-focus-bg);
  box-shadow:var(--auth-focus-glow);
}

/* Keep dark-theme browser autofill matching the obsidian well */
:root:not([data-theme="light"]) .input-group input:-webkit-autofill,
html[data-theme="dark"] .input-group input:-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #09111E inset;
  -webkit-text-fill-color:var(--ice);
  caret-color:var(--cyan);
}

/* Set by scripts via aria-invalid; colour is paired with error text below */
.input-group input[aria-invalid="true"],
.auth-input[aria-invalid="true"]{
  border-color:var(--danger);
  box-shadow:inset 0 0 0 1px var(--danger),0 0 0 3px var(--auth-error-ring);
}

.password-field{position:relative;display:flex;align-items:center}
.password-field input{padding-right:48px}

/* Frozen togglePasswordVisibility() replaces button.textContent with Hide/Show
   and updates aria-label, so the eye glyph lives in CSS background-image keyed
   off aria-label - preserving accessible name and icon with zero JS changes. */
.password-toggle{
  position:absolute;right:8px;width:34px;height:34px;min-height:34px;padding:0;
  background-color:transparent;border:0;border-radius:var(--r-sm);cursor:pointer;
  font-size:0;color:transparent; /* hides Show/Hide text visually while keeping accessible name */
  background-repeat:no-repeat;background-position:center;background-size:19px 19px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.8-7 10-7 10 7 10 7-3.8 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  transition:background-color .16s ease;
}
.password-toggle[aria-label="Hide password"]{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322D3EE' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.8-7 10-7 10 7 10 7-3.8 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
}
.password-toggle:hover{background-color:rgba(148,163,184,.14)}

html[data-theme="light"] .password-toggle{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358574F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.8-7 10-7 10 7 10 7-3.8 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
html[data-theme="light"] .password-toggle[aria-label="Hide password"]{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E7490' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.8-7 10-7 10 7 10 7-3.8 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
}
html[data-theme="light"] .password-toggle:hover{background-color:rgba(35,36,31,.07)}

/* ---------- helper + error + alert surfaces ---------- */

.field-hint,.password-hint{margin:7px 0 0;font-size:.8rem;color:var(--steel);line-height:1.45}
.field-error,.modal-validation-error{margin:7px 0 0;font-size:.82rem;font-weight:500;color:var(--danger)}

/* Scripts flip display between none and block. The leading glyph sits in
   background-image so it survives errEl.textContent = message. */
.login-error{
  display:none;
  padding-block:11px;padding-left:38px;padding-right:14px;
  margin-block:4px 18px;
  background-color:var(--auth-error-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F87171' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8h.01M11 12h1v4h1'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:13px 12px;background-size:16px 16px;
  border:1px solid var(--auth-error-border);border-radius:var(--r-md);
  color:var(--danger);font-size:.84rem;line-height:1.45;text-align:left;
}
html[data-theme="light"] .login-error{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B42318' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8h.01M11 12h1v4h1'/%3E%3C/svg%3E");
}

/* #alert-box (forgot.html). className is REASSIGNED by showAlert(), so rules
   must live strictly on .alert / .alert-error / .alert-success. */
.alert{
  display:none;padding-inline:14px;padding-block:11px;margin-bottom:18px;
  border-radius:var(--r-md);font-size:.86rem;line-height:1.45;border:1px solid transparent;
}
.alert-error{background:var(--auth-error-bg);border-color:var(--auth-error-border);color:var(--danger)}
.alert-success{background:var(--auth-success-bg);border-color:var(--auth-success-border);color:var(--success)}

/* width + background are written inline by the page scripts; CSS owns the track */
.strength-track{height:5px;border-radius:var(--r-pill);background:rgba(148,163,184,.18);overflow:hidden;margin-top:9px}

/* Turnstile container adds spacing only when Cloudflare renders a widget inside */
.cf-turnstile:not(:empty){display:flex;justify-content:center;margin-bottom:18px}

/* ---------- buttons ---------- */

.btn-auth,.btn-login,.btn-action,.btn-confirm,.btn{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:100%;min-height:50px;padding-inline:20px;padding-block:13px;
  border:0;border-radius:var(--r-md);
  font-family:"Space Grotesk",system-ui,sans-serif;font-size:.98rem;font-weight:700;letter-spacing:.01em;
  cursor:pointer;text-decoration:none;
  transition:background .18s ease,box-shadow .18s ease,transform .12s ease;
}

.btn-auth,.btn-login,.btn-action,.btn-confirm,.btn-primary{
  background:var(--auth-btn-bg);color:var(--on-cyan);box-shadow:var(--auth-btn-shadow);
}

.btn-auth:hover,.btn-login:hover,.btn-action:hover,.btn-confirm:hover,.btn-primary:hover{
  background:var(--auth-btn-hover-bg);box-shadow:var(--auth-btn-hover-shadow);
  text-decoration:none;transform:translateY(-1px);
}

.btn-auth:active,.btn-login:active,.btn-action:active,.btn-confirm:active,.btn:active{
  transform:translateY(0) scale(.988);
}

.btn-auth:disabled,.btn-login:disabled,.btn-action:disabled,.btn-confirm:disabled,.btn:disabled,.btn-ghost:disabled{
  opacity:.55;cursor:not-allowed;transform:none;box-shadow:none;
}

.btn-ghost{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:44px;padding-inline:16px;
  background:transparent;border:1px solid var(--auth-input-border);border-radius:var(--r-md);
  color:var(--ice);font-family:inherit;font-size:.9rem;font-weight:500;cursor:pointer;
  transition:border-color .16s ease,background-color .16s ease,color .16s ease;
}
.btn-ghost:hover:not(:disabled){border-color:var(--cyan);background:var(--auth-info-bg)}

/* .loading is toggled by the page scripts; button box stays stable while spinning */
.btn-auth.loading,.btn-login.loading,.btn-action.loading,.btn-confirm.loading{color:transparent;pointer-events:none}
.btn-auth.loading .loader,.btn-login.loading .loader,.btn-action.loading .loader,.btn-confirm.loading .loader{display:block}
.btn.loading .btn-text{visibility:hidden}
.btn.loading .btn-loader{display:block}

.loader,.btn-loader{
  display:none;position:absolute;top:50%;left:50%;
  width:20px;height:20px;margin:-10px 0 0 -10px;
  border:2px solid rgba(4,18,26,.28);border-top-color:var(--on-cyan);
  border-radius:50%;animation:auth-spin .7s linear infinite;
}
html[data-theme="light"] .loader,
html[data-theme="light"] .btn-loader{border-color:rgba(255,255,255,.35);border-top-color:#fff}
@keyframes auth-spin{to{transform:rotate(360deg)}}

/* ---------- row utilities + dividers + trust strip ---------- */

.auth-row{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin-bottom:20px;font-size:.86rem;
}

.auth-check{
  display:inline-flex;align-items:center;gap:9px;
  color:var(--steel);cursor:pointer;min-height:24px; /* WCAG SC 2.5.8 target size */
}
.auth-check:hover{color:var(--ice)}
.auth-check input[type="checkbox"]{width:18px;height:18px;margin:0;accent-color:var(--cyan);cursor:pointer}

.auth-divider,.invite-divider{
  display:flex;align-items:center;gap:14px;margin-block:22px;
  color:var(--steel);font-size:.76rem;font-weight:500;letter-spacing:.08em;
}
.auth-divider::before,.auth-divider::after,
.invite-divider::before,.invite-divider::after{content:"";flex:1;height:1px}
.auth-divider::before,.invite-divider::before{background:linear-gradient(90deg,transparent,var(--line))}
.auth-divider::after,.invite-divider::after{background:linear-gradient(90deg,var(--line),transparent)}

.auth-foot,.footer-text{margin:24px 0 0;text-align:center;color:var(--steel);font-size:.88rem}
.auth-foot a,.footer-text a{font-weight:500}

/* Password requirements list on the reset screen (static guidance) */
.auth-checklist{
  list-style:none;margin:0 0 20px;padding:14px 16px;
  display:grid;gap:9px;
  background:var(--auth-surface-subtle);border:1px solid var(--line);border-radius:var(--r-md);
  font-size:.82rem;color:var(--steel);
}
.auth-checklist li{display:flex;gap:9px;align-items:flex-start}
.auth-checklist li::before{
  content:"";flex:0 0 auto;width:14px;height:14px;margin-top:.18em;
  background-repeat:no-repeat;background-position:center;background-size:14px 14px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322D3EE' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}
html[data-theme="light"] .auth-checklist li::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E7490' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

/* Trust strip at the foot of the verification and recovery screens */
.auth-meta{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin:20px 0 0;padding-top:14px;border-top:1px solid var(--line);
  color:var(--steel);font-size:.74rem;letter-spacing:.02em;
}
.auth-meta-ok{color:var(--cyan);font-weight:500}

.google-slot{display:flex;justify-content:center;width:100%;max-width:100%;min-height:44px}

/* ---------- OTP ----------
   .otp-inputs is a querySelectorAll target in verify-email.js. */

.otp-inputs{display:flex;gap:10px;justify-content:center;margin-block:8px 18px}

.otp-inputs input{
  flex:1 1 auto;min-width:0;min-height:62px;padding-inline:14px;
  background:var(--auth-input-bg);border:1px solid var(--auth-input-border);border-radius:var(--r-md);
  color:var(--ice);caret-color:var(--cyan);
  font-family:"Space Grotesk",ui-monospace,monospace;font-variant-numeric:tabular-nums;
  font-size:1.62rem;font-weight:700;text-align:center;
  letter-spacing:.44em;text-indent:.44em; /* re-centres text that trailing letter-spacing shifts left */
  transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease;
}
.otp-inputs input:hover{border-color:var(--auth-input-hover-border)}
.otp-inputs input:focus{
  outline:2px solid var(--cyan);outline-offset:2px;
  border-color:var(--cyan);background:var(--auth-input-focus-bg);
  box-shadow:var(--auth-focus-glow);
}

.resend-box{margin:18px 0 0;text-align:center;color:var(--steel);font-size:.86rem}

/* #resend-link gets .disabled toggled by startTimer(); adjacent timer text
   explains why it is disabled so colour is never the sole cue. */
.resend-box button,.resend-box a{
  background:none;border:0;padding:6px 4px;min-height:24px;
  color:var(--cyan);font:inherit;font-weight:500;cursor:pointer;
  text-decoration:underline;text-underline-offset:3px;
}
.resend-box button.disabled,.resend-box a.disabled{
  /* Dim by colour, not opacity, so a focus ring stays fully visible. */
  color:color-mix(in srgb,var(--steel) 60%,transparent);cursor:not-allowed;pointer-events:none;text-decoration:none;
}

/* ---------- modal (Google confirm-company dialog) ----------
   .open is toggled by login.js and register.js. */

.modal-overlay{
  display:none;position:fixed;inset:0;z-index:10001;
  /* Scrolls when taller than the view (200% zoom); margin:auto on the box keeps it centred otherwise.
     z-index sits above the language/theme control (.omnexa-preferences is 10000). */
  justify-content:center;padding:20px;overflow-y:auto;
  background:var(--auth-modal-backdrop);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
}
.modal-overlay.open{display:flex}

.modal-box{
  position:relative;width:100%;max-width:440px;margin:auto;
  padding-inline:clamp(22px,4vw,34px);padding-block:clamp(24px,4vw,34px);
  background:var(--auth-modal-bg);border:1px solid var(--auth-card-border);border-radius:22px;
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  box-shadow:var(--auth-card-shadow);
  animation:auth-modal-in .22s cubic-bezier(.16,1,.3,1);
}
.modal-box::before{
  content:"";position:absolute;top:-1px;left:10%;right:10%;height:1px;
  background:var(--auth-card-rim);pointer-events:none;
}
.modal-box h3{font-size:1.3rem;margin-bottom:8px}
.modal-box > p{color:var(--steel);font-size:.9rem;margin:0 0 20px;line-height:1.5}

@keyframes auth-modal-in{
  from{opacity:0;transform:translateY(8px) scale(.98)}
  to{opacity:1;transform:none}
}

/* ---------- accept-invite ----------
   accept-invite.js swaps four state panels via style.display = 'block', so
   initial visibility below must stay: loading visible, other three hidden. */

.loading-state{text-align:center;padding-block:40px;color:var(--steel);font-size:.94rem}
.invalid-state{text-align:center;padding-block:20px;display:none}
.invalid-state h3{font-size:1.4rem;margin-bottom:10px}
.invalid-state p{color:var(--steel);margin:0 0 24px;font-size:.94rem;line-height:1.5}
.form-section{display:none}

.spinner{
  width:34px;height:34px;margin:0 auto 16px;
  border:2px solid rgba(148,163,184,.22);border-top-color:var(--cyan);
  border-radius:50%;animation:auth-spin .7s linear infinite;
}

.email-highlight{color:var(--cyan);font-weight:600}

.info-card{
  display:flex;align-items:center;gap:12px;
  padding-inline:14px;padding-block:12px;margin-bottom:20px;
  background:var(--auth-surface-subtle);border:1px solid var(--hair);border-radius:var(--r-md);
  font-size:.86rem;color:var(--steel);
}
.info-card .info-icon{
  display:grid;place-items:center;flex:0 0 auto;width:32px;height:32px;
  border-radius:var(--r-sm);background:var(--auth-info-bg);color:var(--cyan);
  font-size:1rem;line-height:1;
}
.info-card strong{color:var(--ice);font-weight:600}
.info-text{min-width:0;overflow-wrap:anywhere}

/* #inviteMessage. showMessage() sets el.className = 'message-box ' + type,
   wiping any extra classes, so never rely on additional styling hooks here. */
.message-box{
  display:none;padding-inline:14px;padding-block:11px;margin-bottom:18px;
  border-radius:var(--r-md);border:1px solid transparent;font-size:.86rem;line-height:1.45;
}
.message-box.error{background:var(--auth-error-bg);border-color:var(--auth-error-border);color:var(--danger)}
.message-box.success{background:var(--auth-success-bg);border-color:var(--auth-success-border);color:var(--success)}
.message-box.info{background:var(--auth-info-bg);border-color:var(--hair);color:var(--steel)}

.google-invite-button{display:flex;justify-content:center;max-width:100%;min-height:44px;overflow:hidden}

/* accept-invite.js toggles the hidden property; keep hidden strictly authoritative */
.google-invite-section[hidden]{display:none}

/* ---------- responsive: 1440 -> 1024 -> 640 -> 375 px ---------- */

@media (max-width:1120px){
  .auth-shell{grid-template-columns:minmax(0,49fr) minmax(0,51fr)}
  .auth-main{padding-inline:clamp(18px,3vw,36px)}
  .auth-card{max-width:440px;padding:clamp(24px,3vw,32px)}
  .auth-aside{padding:clamp(20px,3vw,36px)}
  .auth-visual{width:min(100%,440px,62dvh)}
}

/* Below 900px: form stays first above the fold (clearing the floating top-right
   preferences pill); the artwork stage collapses gracefully beneath the card. */
@media (max-width:900px){
  .auth-shell{grid-template-columns:1fr;min-height:100dvh}
  .auth-main{align-items:flex-start;padding:68px 20px 28px}
  .auth-card{max-width:460px;margin-inline:auto}
  .auth-aside{padding:20px 20px 44px;border-top:1px solid var(--auth-stage-divider)}
  .auth-aside::before{display:none}
  .auth-visual{width:min(54vw,228px)}
  .auth-halo{width:min(50vw,210px);top:8%}
}

@media (max-width:480px){
  /* 12px outer + 15px card padding leaves 321px inner width at 375px, fitting
     the 320px Google invite button without clipping or sideways scroll. */
  .auth-main{padding:62px 12px 24px}
  .auth-card{padding:24px 15px;border-radius:18px}
  .auth-name-row{grid-template-columns:1fr;gap:0}
  .auth-row,.auth-meta{flex-wrap:wrap}
  .otp-inputs input{min-height:54px;font-size:1.35rem;letter-spacing:.34em;text-indent:.34em}
  .auth-aside{padding:16px 16px 36px}
  .auth-visual{width:min(56vw,192px)}
  .auth-halo{width:min(52vw,176px)}
}

/* ---------- reduced motion ----------
   Decorative motion (aurora drift, float, orbital ring, modal fade) stops
   completely so the static composition reads as finished. Progress spinners
   remain active as an essential status cue (WCAG SC 2.2.2) at a calmer pace. */

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
  .auth-aurora-orb,.auth-halo,.auth-visual{animation:none;transform:none;will-change:auto}
  .loader,.btn-loader,.spinner{
    animation:auth-spin 1.6s linear infinite !important;
    animation-iteration-count:infinite !important;
  }
  .btn-auth:hover,.btn-login:hover,.btn-action:hover,.btn-confirm:hover,.btn-primary:hover,
  .btn-auth:active,.btn-login:active,.btn-action:active,.btn-confirm:active,.btn:active{transform:none}
}

/* Light theme: a visible hover ring on inputs, drawn inset like the focus ring. */
html[data-theme="light"] :is(.input-group input,.otp-inputs input):hover:not(:focus){box-shadow:inset 0 0 0 1px var(--auth-input-hover-border)}

/* Google draws its button in an iframe with a light colour scheme; under our dark scheme Chrome paints an
   opaque white backdrop behind it (the white frame). Matching the iframe's own scheme makes it transparent. */
iframe[src*="accounts.google.com"]{color-scheme:light}
