/* ============================================================
   Auth pages, Signal Slate (design pass 2026-11-24)
   Log in, sign up (plain / trial / configured plan), password reset (4 pages), the email
   confirm page and "check your email". Matches the landing's Signal Slate plan section
   (static/css/pages/configurator.css, D-S15): deep slate, teal signal, copper primary with
   slate text (AA), 10 px controls, 18 px frames, system type stack (the Signal Slate pair is
   not self-hosted yet). Loads nothing from a third party.
   auth_v2.css stays as it is for the billing pages that still use it.
   Class names the page scripts and tests rely on are kept (auth-field-error, auth-consent,
   auth-password-toggle, auth-alert, auth-features, pw-*).
   ============================================================ */

:root {
    --as-slate: #0A1622;
    --as-harbour: #13212F;
    --as-field: #0E1B28;
    --as-mist: #E8F4F8;
    --as-fog: #A9BCC6;        /* 9.6:1 on slate */
    --as-dim: #8FA4B1;        /* 7.0:1 on slate: the quietest text on these pages */
    --as-line: #23364A;
    --as-line-2: #34506A;
    --as-line-3: #4A6A86;
    --as-teal: #33B0B4;
    --as-link: #6FD0D3;       /* 10:1 on slate */
    --as-focus: #6FD0D3;
    --as-copper: #D99558;
    --as-copper-hi: #E2A46C;
    --as-error: #FF968C;      /* 8.4:1 on slate */
    --as-error-bg: rgba(255, 150, 140, .08);
    --as-ok: #6FD9A8;
    --as-f-display: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --as-f-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --as-r-ctl: 10px;
    --as-r-frame: 18px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.as-body {
    margin: 0;
    min-height: 100vh;
    font: 400 16px/1.6 var(--as-f-body);
    color: var(--as-mist);
    background-color: var(--as-slate);
    /* The landing hero's two quiet glows, fixed so long forms never show a seam. */
    background-image:
        radial-gradient(900px 600px at 100% 0%, rgba(51, 176, 180, .10), transparent 60%),
        radial-gradient(800px 600px at 0% 100%, rgba(217, 149, 88, .07), transparent 60%);
    background-repeat: no-repeat;
    overflow-x: hidden;
}

:where(.as-body) :where(p, h1, h2, ul, ol) { margin: 0; }   /* zero specificity: component rules set their own margins */
.as-body [hidden] { display: none !important; }
:where(.as-top, .as-split, .as-single) :focus-visible { outline: 2px solid var(--as-focus); outline-offset: 3px; }

/* ---------- top bar ---------- */
.as-top {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0 clamp(16px, 4vw, 56px);
    border-bottom: 1px solid #1A2C3D;
    background: rgba(10, 22, 34, .6);
}

.as-top .as-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--as-mist);
    text-decoration: none;
    font: 800 15px/1 var(--as-f-display);
    letter-spacing: .16em;
    text-transform: uppercase;
}

.as-orb { width: 26px; height: 26px; flex: none; }
.as-orb circle { fill: var(--as-teal); }
.as-orb ellipse { fill: none; stroke: var(--as-teal); stroke-width: 1.6; opacity: .7; }

/* ---------- layouts ---------- */
/* Sign-in / sign-up: the form, with the brand card beside it on wide screens and after it on phones. */
.as-split {
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 380px);
    justify-content: center;
    align-items: center;
    gap: clamp(40px, 6vw, 88px);
    max-width: 1120px;
    min-height: calc(100vh - 65px);
    margin: 0 auto;
    padding: 48px clamp(16px, 4vw, 56px) 72px;
}

/* Utility pages (reset, confirm, check your email): one centred card. */
.as-single {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 65px);
    padding: clamp(32px, 8vh, 88px) 16px 72px;
}

.as-card {
    width: 100%;
    max-width: 460px;
    padding: 32px 32px 28px;
    border-radius: var(--as-r-frame);
    border: 1px solid #22364A;
    background: linear-gradient(180deg, rgba(21, 36, 51, .92), rgba(15, 28, 41, .92));
    box-shadow: 0 1px 0 rgba(232, 244, 248, .05) inset, 0 30px 70px rgba(0, 0, 0, .3);
}

.as-form-col { min-width: 0; }

/* ---------- headings ---------- */
.auth-form-header { margin-bottom: 26px; }

.auth-form-header h1 {
    font: 700 clamp(28px, 3.2vw, 36px)/1.1 var(--as-f-display);
    letter-spacing: -.025em;
    color: var(--as-mist);
}

.auth-form-header p {
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--as-fog);
}

.auth-form-header p + p { margin-top: 8px; }
.auth-form-header strong { color: var(--as-mist); font-weight: 600; }

.as-center { text-align: center; }

/* The icon above a utility page's heading (replaces the old emoji). */
.as-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 1px solid rgba(51, 176, 180, .45);
    background: rgba(51, 176, 180, .10);
    color: var(--as-teal);
}

.as-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.as-icon--warn { border-color: rgba(217, 149, 88, .5); background: rgba(217, 149, 88, .10); color: var(--as-copper); }
.as-icon--ok { border-color: rgba(111, 217, 168, .45); background: rgba(111, 217, 168, .10); color: var(--as-ok); }

/* ---------- links ---------- */
/* :where() keeps these at the lowest specificity, so every component's own link rule wins
   (and the 5d plan dialog, outside these containers, is untouched). */
:where(.as-split, .as-single) a { color: var(--as-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(.as-split, .as-single) a:hover { color: #A6E6E8; }
:where(.as-split, .as-single) a:focus-visible { border-radius: 3px; }

/* ---------- Continue with Google (Google's dark-theme button: #131314 fill, #8E918F stroke,
   #E3E3E3 label, the four-colour G unchanged; state layers of the label colour at 8 % / 12 %) ---------- */
.google-signin { margin: 0; }

.google-signin button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    border: 1px solid #8E918F;
    border-radius: 999px;
    background-color: #131314;
    color: #E3E3E3;
    font: 500 15px/20px Roboto, "Segoe UI", Arial, sans-serif;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

.google-signin button svg { width: 20px; height: 20px; flex: none; }
.google-signin button:hover { background-color: #242425; border-color: #A8ABA9; }
.google-signin button:active { background-color: #2C2C2D; }
.google-signin button:focus-visible { background-color: #2C2C2D; outline: 2px solid var(--as-focus); outline-offset: 3px; }

.google-signin .auth-footer-text {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--as-fog);
    text-align: center;
}

.google-signin .auth-footer-text a { color: var(--as-mist); }

.google-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    font-size: 13px;
    color: var(--as-fog);
}

.google-divider::before, .google-divider::after { content: ""; flex: 1; border-top: 1px solid var(--as-line); }

/* ---------- fields ---------- */
.auth-field { margin-bottom: 18px; }

.auth-label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--as-mist);
}

.auth-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--as-line-2);
    border-radius: var(--as-r-ctl);
    background: var(--as-field);
    color: var(--as-mist);
    font: 400 16px/1.4 var(--as-f-body);   /* 16 px: iOS doesn't zoom on focus */
    transition: border-color .15s, box-shadow .15s;
}

.auth-input::placeholder { color: #7891A3; opacity: 1; }
.auth-input:hover { border-color: var(--as-line-3); }
/* transparent outline: invisible normally, drawn by forced-colours mode, where box-shadow is dropped */
.auth-input:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--as-teal); box-shadow: 0 0 0 3px rgba(51, 176, 180, .28); }
.auth-input[aria-invalid="true"] { border-color: var(--as-error); }
.auth-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 150, 140, .25); }

.auth-input-help { margin-top: 7px; font-size: 13px; line-height: 1.5; color: var(--as-fog); }
.auth-input-help ul { margin: 0; padding-left: 18px; }

/* Field-level errors (server and the page scripts' consent / Turnstile messages). */
.auth-field-error {
    position: relative;
    display: block;             /* the page scripts toggle #ts-status with style.display = 'block' */
    padding-left: 26px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--as-error);
}

.auth-field-error::before {
    content: "!";
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--as-error);
    color: var(--as-slate);
    font: 800 12px/1 var(--as-f-body);
}

.auth-field-error:empty { display: none; }

/* Password with a show/hide toggle inside it: a 44x44 px tap target. */
.auth-password-wrap { position: relative; }
.auth-password-wrap .auth-input { padding-right: 56px; }

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--as-fog);
    cursor: pointer;
}

.auth-password-toggle[hidden] { display: none; }
.auth-password-toggle:hover { color: var(--as-mist); background: rgba(51, 176, 180, .08); }
.auth-password-toggle:focus-visible { outline: 2px solid var(--as-focus); outline-offset: -2px; }
.auth-password-toggle .pw-eye-off, .auth-password-toggle.is-shown .pw-eye { display: none; }
.auth-password-toggle.is-shown .pw-eye-off { display: block; }

/* Strength meter + rule checks (advisory; see register.html). Readable: 13 px, fog on slate. */
.pw-meter { margin-top: 10px; }
.pw-meter-track { height: 4px; border-radius: 2px; background: rgba(143, 164, 177, .22); overflow: hidden; }
.pw-meter-fill { height: 100%; width: 0; border-radius: 2px; background: var(--as-dim); transition: width .18s ease, background-color .18s ease; }
.pw-meter-fill.pw-s0 { background: #E5645A; }
.pw-meter-fill.pw-s1 { background: #E08A3C; }
.pw-meter-fill.pw-s2 { background: #D4B03A; }
.pw-meter-fill.pw-s3 { background: #5FC08A; }
.pw-meter-fill.pw-s4 { background: var(--as-teal); }
.pw-meter-label { min-height: 20px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--as-fog); }
.pw-meter-label:empty { min-height: 0; margin-top: 0; }

.pw-rules {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--as-fog);
}

.pw-rules li { position: relative; padding-left: 22px; }

/* not yet assessed: a hollow ring */
.pw-rules li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .3em;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid var(--as-dim);
}

.pw-rules li.is-ok { color: var(--as-ok); }
.pw-rules li.is-ok::before { top: .25em; width: 12px; height: 7px; border: 0; border-left: 2px solid var(--as-ok); border-bottom: 2px solid var(--as-ok); border-radius: 0; transform: rotate(-45deg); }
.pw-rules li.is-bad { color: var(--as-error); }
.pw-rules li.is-bad::before { border-color: var(--as-error); background: var(--as-error); }

/* ---------- the consent checkbox: the whole row is the tap target (>= 48 px) ---------- */
.auth-consent { margin: 22px 0 20px; }

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid var(--as-line-2);
    border-radius: 12px;
    background: rgba(19, 33, 47, .65);
    transition: border-color .15s, background-color .15s;
}

.auth-check:hover { border-color: var(--as-line-3); }
.auth-check:has(input:checked) { border-color: rgba(51, 176, 180, .55); background: rgba(51, 176, 180, .07); }
.auth-check:has(input:focus-visible) { border-color: var(--as-teal); }
.auth-check:has(input[aria-invalid="true"]), .auth-consent.is-invalid .auth-check { border-color: var(--as-error); background: var(--as-error-bg); }

/* The box's own hit area: 44x48 px, centred on the 22 px square. */
.auth-check-box {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 48px;
    margin: 0 -11px;
    cursor: pointer;
}

.auth-check input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid #7891A3;
    border-radius: 6px;
    background: var(--as-field) center / 14px 14px no-repeat;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}

.auth-check input[type="checkbox"]:hover { border-color: var(--as-mist); }

.auth-check input[type="checkbox"]:checked {
    border-color: var(--as-teal);
    background-color: var(--as-teal);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230A1622' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.auth-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--as-focus); outline-offset: 2px; }
.auth-check input[type="checkbox"][aria-invalid="true"] { border-color: var(--as-error); }

.auth-check label:not(.auth-check-box) {
    flex: 1;
    min-height: 48px;
    padding: 12px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--as-fog);
    cursor: pointer;
}

.auth-check label a { color: var(--as-mist); font-weight: 600; }
.auth-check label a:hover { color: #FFFFFF; }

/* Windows high contrast / forced colours: hand the checkbox back to the system. */
@media (forced-colors: active) {
    .auth-check input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; background: none; }
}

/* ---------- Turnstile ---------- */
.cf-turnstile { margin: 0 0 16px; }
.cf-turnstile:empty { margin: 0; }
#ts-status { margin: -4px 0 16px; }

/* ---------- buttons ---------- */
.auth-btn-primary {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;                     /* vertical room when a long label wraps at phone width */
    border: 1px solid transparent;
    border-radius: var(--as-r-ctl);
    background: var(--as-copper);
    color: var(--as-slate);                 /* 7.6:1: slate on copper, as on the landing */
    font: 700 16px/1.3 var(--as-f-body);    /* 1.3, not 1: "Create account and continue to checkout" wraps at 390 px */
    text-align: center;
    text-wrap: balance;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(217, 149, 88, .22);
    transition: background-color .2s, box-shadow .25s;
}

a.auth-btn-primary { color: var(--as-slate); text-decoration: none; }
.auth-btn-primary:hover, a.auth-btn-primary:hover { background: var(--as-copper-hi); color: var(--as-slate); box-shadow: 0 10px 34px rgba(217, 149, 88, .35); }
.auth-btn-primary:focus-visible { outline: 2px solid var(--as-focus); outline-offset: 3px; }
.auth-btn-primary:disabled { opacity: .75; cursor: progress; box-shadow: none; }

.auth-btn-outline {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: 1px solid #3B566F;
    border-radius: var(--as-r-ctl);
    background: transparent;
    color: var(--as-mist);
    font: 600 15px/1.3 var(--as-f-body);
    text-align: center;
    text-wrap: balance;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}

a.auth-btn-outline { color: var(--as-mist); text-decoration: none; }
.auth-btn-outline:hover, a.auth-btn-outline:hover { border-color: var(--as-teal); background: rgba(51, 176, 180, .08); color: var(--as-mist); }

/* ---------- alerts and info boxes ---------- */
.auth-alert, .auth-info-box, .auth-success-box, .auth-warning-box {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 14px;
    line-height: 1.5;
}

.auth-alert-error { background: var(--as-error-bg); border-color: rgba(255, 150, 140, .38); color: #FFC2BB; }
.auth-alert-warning, .auth-warning-box { background: rgba(217, 149, 88, .09); border-color: rgba(217, 149, 88, .4); color: #F2C9A0; }
.auth-alert-success, .auth-success-box { background: rgba(111, 217, 168, .08); border-color: rgba(111, 217, 168, .35); color: #A8EBC9; }
.auth-alert-info, .auth-info-box { background: rgba(51, 176, 180, .08); border-color: rgba(51, 176, 180, .35); color: #C4ECEE; }
.auth-info-box { color: var(--as-fog); }
.auth-info-box strong { color: var(--as-mist); }
.auth-info-box ol { margin: 8px 0 0; padding-left: 20px; }
.auth-info-box ol li { padding: 2px 0; }
.auth-warning-box p, .auth-info-box p { margin: 0; }
.auth-warning-box p + p, .auth-info-box p + p { margin-top: 8px; }
.as-fine { font-size: 13px; color: var(--as-fog); }

/* A link inside an alert takes the alert's own colour (the confirm page's "reset the password"
   link, browser loop 2026-11-20: the browser's default blue was about 1.5:1 on these boxes). */
.auth-alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.auth-alert a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }

.auth-text-muted { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--as-fog); }

/* ---------- links under the form ---------- */
.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 14px;
    font-size: 14px;
}

.auth-links a { display: inline-flex; align-items: center; min-height: 44px; }

.auth-divider { border: 0; border-top: 1px solid var(--as-line); margin: 20px 0; }

.auth-footer-text { font-size: 14px; line-height: 1.55; color: var(--as-fog); text-align: center; }
.auth-footer-text a { font-weight: 600; }

/* ---------- the brand card ---------- */
.auth-brand {
    padding: 30px 28px;
    border-radius: var(--as-r-frame);
    border: 1px solid #22364A;
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(51, 176, 180, .12), transparent 60%),
        linear-gradient(180deg, rgba(21, 36, 51, .92), rgba(15, 28, 41, .92));
    box-shadow: 0 1px 0 rgba(232, 244, 248, .05) inset, 0 30px 70px rgba(0, 0, 0, .3);
}

.auth-tagline {
    margin: 0 0 20px;
    font: 600 22px/1.3 var(--as-f-display);
    letter-spacing: -.01em;
    color: var(--as-mist);
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 18px 0 0;
    border-top: 1px solid #22364A;
    display: grid;
    gap: 12px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--as-fog);
}

.auth-features li { position: relative; padding-left: 28px; }

.auth-features li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: .38em;
    width: 12px;
    height: 7px;
    border-left: 2px solid var(--as-teal);
    border-bottom: 2px solid var(--as-teal);
    transform: rotate(-45deg);
}

/* The configured plan card (5d) sits in the form column; configurator.css styles it. */

/* ---------- phones and narrow windows ---------- */
@media (max-width: 900px) {
    .as-split {
        grid-template-columns: minmax(0, 480px);
        align-items: start;
        gap: 36px;
        min-height: 0;
        padding: 28px 16px 56px;
    }

    .auth-form-header { margin-bottom: 22px; }
    .auth-brand { padding: 24px 20px; }
    .auth-tagline { font-size: 19px; margin-bottom: 16px; }
    .auth-features { font-size: 14.5px; gap: 10px; padding-top: 16px; }
}

@media (max-width: 500px) {
    .as-top { min-height: 56px; padding: 0 16px; }
    .as-split { padding-top: 22px; }
    .as-single { padding: 24px 16px 56px; }
    .as-card { padding: 24px 18px 22px; border-radius: 16px; }
    .auth-form-header h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .as-body *, .as-body *::before, .as-body *::after { transition: none !important; }
}

/* small utility used by the confirm page */
.as-after { margin: 18px 0 0; }
.as-card .auth-form-header h1 { font-size: 26px; letter-spacing: -.02em; }
.as-card .auth-form-header { margin-bottom: 22px; }
