/* ==========================================================================
   Customer account-access pages: Sign Up, Log In, Forgot / Reset Password, Verify email, two-factor, joint invitation.
   Same white-and-blue palette, typography and form controls as the customer dashboard (assets/css/ox.css tokens,
   owner request 2026-12-03); light and dark mode. Back-office sign-in is styled separately (admin.css).
   ========================================================================== */
body.auth-page {
  --ox-ink: #0B1B3F; --ox-ink-2: #3B4A66; --ox-muted: #6B7A99;
  --ox-blue: #0B4FE0; --ox-blue-600: #0A43C2; --ox-blue-soft: #E8EFFE; --ox-blue-line: #C9D8FB;
  --ox-page: linear-gradient(180deg, #F3F6FC 0%, #EEF3FC 100%);
  --ox-card: #FFFFFF; --ox-card-2: #F6F8FD; --ox-line: #E3E9F4; --ox-line-2: #EDF1F8;
  --ox-red: #DC2626; --ox-red-soft: #FDE3E3; --ox-green: #15803D; --ox-green-soft: #DCF5E5;
  --ox-shadow: 0 1px 2px rgba(11, 27, 63, .04), 0 8px 24px rgba(11, 27, 63, .06);
  --ox-hero: radial-gradient(120% 140% at 100% 100%, rgba(59, 130, 246, .55) 0, transparent 55%), linear-gradient(135deg, #0B3FD6 0%, #0B4FE0 45%, #1D5CF0 100%);
  --head-bg: rgba(255, 255, 255, .82);
  /* base tokens used by app.css components (.field, .alert, .check, .hint …) */
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --text: var(--ox-ink); --text-2: var(--ox-ink-2); --muted: var(--ox-muted); --panel: var(--ox-card); --elev: var(--ox-card-2);
  --border: var(--ox-line); --brand: var(--ox-blue); --brand-600: var(--ox-blue-600); --brand-text: var(--ox-blue); --on-brand: #fff;
  --red-text: var(--ox-red); --focus: 0 0 0 3px rgba(11, 79, 224, .28);
  min-height: 100svh; display: flex; flex-direction: column; margin: 0;
  background: var(--ox-page); color: var(--ox-ink); font-family: var(--font); font-size: 15px;
}
:root[data-theme="dark"] body.auth-page {
  --ox-ink: #E6EDFA; --ox-ink-2: #B4C1DA; --ox-muted: #8392B0;
  --ox-blue: #3B82F6; --ox-blue-600: #2563EB; --ox-blue-soft: rgba(59, 130, 246, .16); --ox-blue-line: rgba(59, 130, 246, .38);
  --ox-page: linear-gradient(180deg, #070D1A 0%, #0A1222 100%);
  --ox-card: #0F1A2E; --ox-card-2: #13203A; --ox-line: #1E2B45; --ox-line-2: #18243B;
  --ox-red: #F87171; --ox-red-soft: rgba(248, 113, 113, .14); --ox-green: #34D399; --ox-green-soft: rgba(52, 211, 153, .14);
  --ox-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --ox-hero: radial-gradient(120% 140% at 100% 100%, rgba(96, 165, 250, .35) 0, transparent 55%), linear-gradient(135deg, #0A2E9E 0%, #0B3FD6 50%, #1D4ED8 100%);
  --head-bg: rgba(10, 18, 34, .82);
  --focus: 0 0 0 3px rgba(96, 165, 250, .45);
  color-scheme: dark;
}
:root[data-theme="light"] body.auth-page { color-scheme: light; }

/* ---------- header (logo · Home · theme) ---------- */
.auth-page .auth-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 28px; padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box;
  background: var(--head-bg); border-bottom: 1px solid var(--ox-line); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.auth-page .auth-brand { display: inline-flex; align-items: center; min-width: 0; height: 44px; color: var(--ox-ink); text-decoration: none; }
.auth-page .auth-brand .brand-logo { height: 32px; max-width: 170px; object-fit: contain; }
.auth-page .auth-brand .brand-mark { font-weight: 800; }
.auth-page .auth-brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ox-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-page .auth-head-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.auth-page .auth-home { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ox-ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-page .auth-home:hover { background: var(--ox-blue-soft); color: var(--ox-blue); }
.auth-page .auth-icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--ox-line); border-radius: 12px; background: var(--ox-card); color: var(--ox-ink-2); cursor: pointer; }
.auth-page .auth-icon-btn:hover { color: var(--ox-blue); border-color: var(--ox-blue-line); }
.auth-page .theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .auth-page .theme-toggle .ic-sun { display: inline-grid; }
:root[data-theme="dark"] .auth-page .theme-toggle .ic-moon { display: none; }

/* ---------- body: blue hero panel (desktop) + form card ---------- */
.auth-page .auth-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 40px 24px 32px; min-width: 0; }
.auth-page .auth-wrap { width: 100%; max-width: 980px; min-height: 0; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); background: var(--ox-card); border: 1px solid var(--ox-line); border-radius: 20px; box-shadow: var(--ox-shadow); overflow: hidden; }
.auth-page--wide .auth-wrap { max-width: 1060px; }
.auth-page .auth-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 36px; background: var(--ox-hero); color: #fff; overflow: hidden; isolation: isolate; }
.auth-page .auth-hero-kicker { display: block; margin-bottom: 14px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.auth-page .auth-hero h2 { margin: 0; color: #fff; font-size: 30px; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; }
.auth-page .auth-hero-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-page .auth-hero-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.auth-page .auth-hero-list svg { flex: 0 0 auto; width: 34px; height: 34px; padding: 8px; box-sizing: border-box; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.auth-page .auth-hero-trace { position: absolute; left: 0; right: 0; bottom: 120px; width: 100%; height: 120px; color: rgba(255, 255, 255, .28); z-index: -1; pointer-events: none; }
.auth-page .auth-card { width: auto; max-width: none; padding: 40px 44px 36px; min-width: 0; }

/* ---------- headings and text ---------- */
.auth-page .auth-card h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; color: var(--ox-ink); }
.auth-page .auth-card h1 + p { margin: 0 0 24px; color: var(--ox-ink-2); font-size: 15px; line-height: 1.55; }
.auth-page .auth-card p { color: var(--ox-ink-2); }
.auth-page .auth-card a:not(.btn) { color: var(--ox-blue); font-weight: 600; text-decoration: none; }
.auth-page .auth-card a:not(.btn):hover { text-decoration: underline; }
.auth-page .muted { color: var(--ox-muted); }

/* ---------- form controls (dashboard ox-field look) ---------- */
.auth-page .auth-card form { margin-top: 8px; }
.auth-page .field { gap: 7px; }
.auth-page .auth-card form > .field, .auth-page .auth-card form > .field-row { margin-top: 16px; }
.auth-page .auth-card form > .field:first-of-type, .auth-page .auth-card form > .field-row:first-of-type { margin-top: 0; }
.auth-page .auth-card form > .hint { margin-top: 8px; }
.auth-page .field-row { gap: 14px; }
.auth-page .field-row .field + .field { margin-top: 0; }
.auth-page .field label:not(.check) { font-size: 14px; font-weight: 600; color: var(--ox-ink); }
.auth-page .field label .opt { font-weight: 500; color: var(--ox-muted); }
.auth-page .field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-page .field-top a { font-size: 13px; }
.auth-page input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .auth-page select {
  width: 100%; min-height: 48px; height: 48px; padding: 0 14px; box-sizing: border-box; border: 1px solid var(--ox-line); border-radius: 10px;
  background: var(--ox-card); color: var(--ox-ink); font: inherit; font-size: 16px; box-shadow: none; }
.auth-page select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236B7A99' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.auth-page select option { background: var(--ox-card); color: var(--ox-ink); }
.auth-page input::placeholder { color: var(--ox-muted); opacity: .8; }
.auth-page input:hover, .auth-page select:hover { border-color: var(--ox-blue-line); }
.auth-page input:focus, .auth-page select:focus { outline: none; border-color: var(--ox-blue); box-shadow: var(--focus); }
.auth-page input[readonly] { background: var(--ox-card-2); color: var(--ox-ink-2); }
.auth-page .is-invalid, .auth-page .is-invalid:focus { border-color: var(--ox-red) !important; }
.auth-page .error-text { font-size: 13px; line-height: 1.45; color: var(--ox-red); font-weight: 600; }
.auth-page .hint { font-size: 13px; line-height: 1.45; color: var(--ox-muted); }
.auth-page .check { gap: 10px; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--ox-ink-2); }
.auth-page input[type=checkbox] { accent-color: var(--ox-blue); width: 18px; height: 18px; margin-top: 1px; }

.auth-page .auth-password { position: relative; width: 100%; min-width: 0; }
.auth-page .auth-password input { padding-right: 52px; }
.auth-page .auth-password-toggle { position: absolute; right: 3px; top: 3px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ox-muted); cursor: pointer; }
.auth-page .auth-password-toggle:hover, .auth-page .auth-password-toggle[aria-pressed="true"] { color: var(--ox-blue); background: var(--ox-blue-soft); }
.auth-page .auth-password-toggle[aria-pressed="true"]::after { content: ""; position: absolute; width: 22px; height: 1.5px; background: currentColor; transform: rotate(-45deg); }

/* arithmetic challenge (Sign Up only): question · answer · new question */
.auth-page .auth-challenge { display: flex; align-items: stretch; gap: 10px; }
.auth-page .auth-challenge-q { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 108px; height: 48px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--ox-blue-line); border-radius: 10px; background: var(--ox-blue-soft); color: var(--ox-ink); font-size: 18px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.auth-page .auth-challenge input { flex: 1 1 auto; min-width: 0; width: auto !important; }
.auth-page .auth-challenge-refresh { flex: 0 0 auto; display: inline-grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--ox-line); border-radius: 10px; background: var(--ox-card); color: var(--ox-ink-2); cursor: pointer; }
.auth-page .auth-challenge-refresh:hover { color: var(--ox-blue); border-color: var(--ox-blue-line); }
.auth-page .auth-challenge-refresh.is-busy svg { animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---------- buttons ---------- */
.auth-page .btn { font-family: inherit; }
.auth-page .btn-primary { height: 50px; padding: 0 22px; border: 1px solid var(--ox-blue); border-radius: 11px; background: var(--ox-blue); color: #fff; font-size: 16px; font-weight: 700; box-shadow: none; }
.auth-page .btn-primary:hover { background: var(--ox-blue-600); border-color: var(--ox-blue-600); }
.auth-page .btn-secondary, .auth-page .btn-ghost { height: 48px; border-radius: 11px; border: 1px solid var(--ox-blue-line); background: var(--ox-card); color: var(--ox-blue); font-weight: 700; }
.auth-page .btn-lg { height: 50px; }
.auth-page .btn-block { width: 100%; }

/* ---------- messages ---------- */
.auth-page .alert { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; color: var(--ox-ink); border: 1px solid var(--ox-line); background: var(--ox-card-2); }
.auth-page .alert-error { background: var(--ox-red-soft); border-color: transparent; }
.auth-page .alert-error svg { color: var(--ox-red); }
.auth-page .alert-success { background: var(--ox-green-soft); border-color: transparent; }
.auth-page .alert-success svg { color: var(--ox-green); }
.auth-page .alert-info { background: var(--ox-blue-soft); border-color: transparent; }
.auth-page .alert-info svg { color: var(--ox-blue); }
.auth-page .flashes, .auth-page .flash-stack { margin: 0 0 8px; }

.auth-page .auth-foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--ox-line-2); text-align: center; font-size: 14px; color: var(--ox-ink-2); }
.auth-page .auth-foot-bar { display: flex; justify-content: space-between; gap: 12px; max-width: 980px; width: 100%; box-sizing: border-box; margin: 0 auto; padding: 4px 24px 28px; color: var(--ox-muted); font-size: 12px; }
.auth-page .skip-link { background: var(--ox-blue); color: #fff; }
.auth-page :focus-visible { outline: none; box-shadow: var(--focus); }
.auth-page .auth-card { animation: auth-appear .35s ease both; }
@keyframes auth-appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .auth-page .auth-wrap { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .auth-page--wide .auth-wrap { max-width: 620px; }
  .auth-page .auth-hero { display: none; }
}
@media (max-width: 600px) {
  .auth-page .auth-head { height: 60px; padding: 0 16px; padding-top: env(safe-area-inset-top, 0px); }
  .auth-page .auth-brand .brand-logo { height: 28px; max-width: 140px; }
  .auth-page .auth-brand-name { font-size: 19px; }
  .auth-page .auth-home span { display: none; }
  .auth-page .auth-home { width: 40px; padding: 0; justify-content: center; }
  .auth-page .auth-main { padding: 16px 12px 20px; }
  .auth-page .auth-wrap { border-radius: 16px; }
  .auth-page .auth-card { padding: 24px 18px 22px; }
  .auth-page .auth-card h1 { font-size: 26px; }
  .auth-page .auth-card h1 + p { font-size: 14px; margin-bottom: 18px; }
  .auth-page .field-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .auth-page .auth-foot-bar { padding: 0 16px 20px; font-size: 11px; }
}
@media (max-width: 360px) {
  .auth-page .auth-card { padding: 20px 14px; }
  .auth-page .auth-challenge { gap: 8px; }
  .auth-page .auth-challenge-q { min-width: 88px; padding: 0 10px; font-size: 17px; }
  .auth-page .auth-challenge-refresh { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page .auth-card { animation: none; }
  .auth-page .auth-challenge-refresh.is-busy svg { animation: none; }
}
html:has(body.auth-page) { background: #EEF3FC; }
html[data-theme="dark"]:has(body.auth-page) { background: #0A1222; }
