/* ==========================================================================
   Manch — the authentication screens.

   Values here are taken from the reference build (manch-login.html) rather
   than measured off a screenshot: the tokens, type sizes, spacing and radii
   are its own. Scoped under .authpage, because app.css owns the short generic
   names and reaches every page.
   ========================================================================== */

.authpage {
    /* --- the reference's palette, verbatim --- */
    --stage:  #140f1b;
    --deep:   #0E0A14;
    --ash:    #1E1826;
    --ash2:   #261F30;
    --edge:   #332B40;
    --ember:  #FF3B12;
    --flame:  #FF7A18;
    --filament: #FFC42E;
    --bone:   #F4EEE6;
    --smoke:  #9990A3;
    --faint:  #655B73;
    --heat:   linear-gradient(180deg, #FFD84D 0%, #FF7A18 45%, #FF2E0B 100%);

    --display: "Bricolage Grotesque", Georgia, serif;
    --body:    "IBM Plex Sans", system-ui, sans-serif;
    --mono:    "IBM Plex Mono", ui-monospace, monospace;

    /* app.css makes the body a flex column with min-height:100vh, so filling
       the screen means growing inside it. max-height rather than height: as a
       flex item the flex-basis replaces the height property and only the
       maximum still binds. */
    flex: 1;
    display: flex;
    max-height: 100vh;
    min-height: 0;
    /* app.css gives every <main> a bottom padding meant for ordinary pages;
       here it showed as a band of bare body under the card. */
    padding-bottom: 0;
    /* One fold: the page never scrolls. A form taller than the screen scrolls
       inside its own column instead, so the stage half stays put. */
    overflow: hidden;

    background: var(--stage);
    color: var(--bone);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.55;
}

.authpage h1,
.authpage h2 {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.06;
}

.authpage :focus-visible {
    outline: 2px solid var(--filament);
    outline-offset: 3px;
    border-radius: 4px;
}

.authpage .authcard {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 0;
}

/* Grid items default to min-height:auto, which would let a tall form push the
   card past the fold instead of scrolling inside it. */
.authpage .authart,
.authpage .authform { min-height: 0; }

/* --- left: the stage ------------------------------------------------------- */

.authpage .authart {
    position: relative;
    overflow: hidden;
    background: var(--deep);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 46px;
}

/* Heat rising from the floor of the stage. */
.authpage .authart::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -180px;
    transform: translateX(-50%);
    width: 120%;
    height: 520px;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(255, 122, 24, 0.22), rgba(255, 59, 18, 0.07) 45%, transparent 72%);
}

.authpage .authart > * { position: relative; z-index: 2; }

.authpage .authart__logo {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin-left: -10px;
}

/* The promise: the middle band of the stage. */
.authpage .authart__inner { max-width: 400px; margin-top: 44px; }
.authpage .authart__headline { font-size: clamp(24px, 3.2vw, 34px); }
.authpage .authart__headline .accent { color: inherit; }
.authpage .authart__body {
    margin: 14px 0 0;
    font-size: 15px;
    color: var(--smoke);
}

/* --- the proof points ------------------------------------------------------ */

.authpage .authart__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    margin-top: auto;
    padding-top: 40px;
}

.authpage .authstat { display: block; }

.authpage .authstat__value {
    display: block;
    font-family: var(--display);
    font-weight: 800;
    font-size: 23px;
    letter-spacing: -0.02em;
    /* The number is cut out of the flame rather than painted with it. */
    background: var(--heat);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}

.authpage .authstat__label {
    display: block;
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    white-space: nowrap;
}

/* --- right: the form ------------------------------------------------------- */

.authpage .authform {
    background: var(--stage);
    padding: 44px 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--edge);
    overflow-y: auto;
    scrollbar-width: thin;
}

.authpage .authform__inner { width: 100%; max-width: 430px; }

.authpage .auth-eyebrow {
    display: block;
    margin-bottom: 10px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--flame);
}

.authpage .auth-title { font-size: 27px; margin-bottom: 8px; }
.authpage .auth-title .brand { color: inherit; }

.authpage .auth-sub {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--smoke);
}

/* --- fields ---------------------------------------------------------------- */

.authpage .authfield { display: block; margin-bottom: 15px; }

.authpage .authfield__label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bone);
}

.authpage .authinput {
    width: 100%;
    /* app.css puts `font: inherit` on every control, and that shorthand also
       sets line-height — which made each field 3px taller than the reference.
       The reference inherits only the family, leaving line-height normal. */
    line-height: normal;
    background: var(--ash);
    border: 1px solid var(--edge);
    border-radius: 10px;
    padding: 12px 13px;
    color: var(--bone);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.18s, background 0.18s;
}
.authpage .authinput::placeholder { color: var(--faint); }
.authpage .authinput:focus {
    border-color: var(--flame);
    background: var(--ash2);
    outline: none;
}
.authpage .authinput[aria-invalid="true"] { border-color: var(--ember); }
.authpage .authinput:disabled { cursor: not-allowed; }

/* Block, not inline: the reference's are <div>s, and as spans the 6px gap
   above them was being dropped and the line box came out 3px short. */
.authpage .authfield__hint,
.authpage .authfield__error { display: block; margin-top: 6px; font-size: 11.5px; }
.authpage .authfield__hint  { color: var(--faint); }
.authpage .authfield__error { color: #FF7A63; }
.authpage .authfield--soon  { opacity: 0.55; }

/* Mobile number: the country code sits beside the field, not inside it. */
.authpage .authsplit { display: flex; gap: 8px; }
.authpage .authprefix {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 13px;
    background: var(--ash);
    border: 1px solid var(--edge);
    border-radius: 10px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--smoke);
}

/* Password, with the reveal inside the field. */
.authpage .authpass { position: relative; display: block; }
.authpage .authpass .authinput { padding-right: 64px; }
.authpage .authpass__toggle {
    line-height: normal;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--smoke);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 9px;
    border-radius: 7px;
    cursor: pointer;
}
.authpage .authpass__toggle:hover { color: var(--bone); background: var(--ash2); }

/* One-time code: six wide characters. */
.authpage .authcode {
    text-align: center;
    font-family: var(--mono);
    font-size: 20px;
    padding: 13px 0;
    letter-spacing: 0.05em;
}

/* --- remember / forgot ------------------------------------------------------ */

.authpage .authrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 18px;
}

.authpage .authcheck {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--smoke);
    cursor: pointer;
}

/* A real checkbox, wearing the reference's box: it still posts remember=1. */
.authpage .authcheck input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
    position: relative;
    border: 1.5px solid var(--edge);
    border-radius: 5px;
    background: none;
    cursor: pointer;
    transition: 0.18s;
}
.authpage .authcheck input:checked { border-color: var(--flame); background: var(--heat); }
.authpage .authcheck input:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 4px;
    height: 9px;
    border: solid #1a0b04;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.authpage .authcheck:has(input:checked) { color: var(--bone); }

.authpage .authlink {
    background: none;
    border: none;
    color: var(--flame);
    font-size: 12.5px;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
}
.authpage .authlink:hover { text-decoration: underline; }

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

.authpage .authbtn {
    line-height: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    background: var(--heat);
    color: #1a0b04;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.12s, filter 0.18s;
}
.authpage .authbtn:hover  { filter: brightness(1.07); }
.authpage .authbtn:active { transform: translateY(1px); }
.authpage .authbtn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

/* --- the other ways in -------------------------------------------------------- */

.authpage .authrule {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.authpage .authrule::before,
.authpage .authrule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--edge);
}

.authpage .authmethods { display: grid; gap: 9px; }

.authpage .authmethod {
    line-height: normal;
    background: var(--ash);
    border: 1px solid var(--edge);
    border-radius: 10px;
    padding: 11px;
    color: var(--bone);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.18s;
}
.authpage .authmethod:hover { border-color: var(--faint); background: var(--ash2); }
.authpage .authmethod[disabled] { opacity: 0.45; cursor: not-allowed; }
.authpage .authmethod[disabled]:hover { border-color: var(--edge); background: var(--ash); }

.authpage .authmethods__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* --- the footnotes ------------------------------------------------------------ */

.authpage .authswitch {
    margin: 22px 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--smoke);
}
.authpage .authswitch a { color: var(--flame); text-decoration: none; }
.authpage .authswitch a:hover { text-decoration: underline; }

.authpage .authlegal {
    margin: 16px 0 0;
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
    color: var(--faint);
}
.authpage .authlegal a { color: var(--smoke); }
.authpage .authlegal a:hover { color: var(--flame); }

/* --- notices -------------------------------------------------------------------- */

.authpage .authnotice {
    border: 1px solid rgba(255, 59, 18, 0.45);
    background: rgba(255, 59, 18, 0.07);
    border-radius: 11px;
    padding: 13px;
    margin-bottom: 16px;
    font-size: 12.5px;
    color: var(--smoke);
    line-height: 1.5;
}
.authpage .authnotice--info {
    border-color: rgba(255, 196, 46, 0.4);
    background: rgba(255, 196, 46, 0.06);
}

/* --- entrance -------------------------------------------------------------------
   Applied by auth.js, one row after another. Decoration only. */

.authpage .reveal { opacity: 0; animation: auth-rise 0.3s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}

/* --- narrower ---------------------------------------------------------------------
   The reference stacks at 940px and drops the promise and the proof points,
   leaving the mark alone above the form. */

@media (max-width: 940px) {
    .authpage { display: block; max-height: none; overflow: visible; }
    .authpage .authcard { grid-template-columns: 1fr; }

    .authpage .authart {
        padding: 34px 24px 30px;
        min-height: auto;
    }
    .authpage .authart__logo { max-width: 290px; margin: 0 auto; }
    .authpage .authart__inner,
    .authpage .authart__stats { display: none; }

    .authpage .authform {
        border-left: none;
        border-top: 1px solid var(--edge);
        padding: 30px 22px 50px;
        overflow: visible;
    }
}

@media (max-width: 420px) {
    .authpage .authart__logo { max-width: 240px; }
    .authpage .authmethods__pair { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .authpage .reveal { opacity: 1; animation: none; }
    .authpage .authbtn, .authpage .authinput, .authpage .authmethod { transition: none; }
}

/* ==========================================================================
   Register — the extra furniture the sign-up flow needs.
   Ported from the reference build (manch-register.html); everything above is
   shared with Sign in.
   ========================================================================== */

/* The three-bar step meter above the form. */
.authpage .progress { display: flex; gap: 7px; margin-bottom: 26px; }
.authpage .progress span {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--ash2);
    transition: background 0.35s;
}
.authpage .progress span.done { background: var(--heat); }

/* "Step 1 of 3" — the eyebrow's twin. */
.authpage .stepnum {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--flame);
    margin-bottom: 10px;
}

/* An optional-field marker sitting inside a label. */
.authpage .authfield__label .opt {
    font-weight: 400;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-left: 7px;
}

/* Choice cards: role and age band. */
.authpage .choices { display: grid; gap: 9px; }
.authpage .choices--two { grid-template-columns: 1fr 1fr; }

.authpage .choice {
    text-align: left;
    background: var(--ash);
    border: 1px solid var(--edge);
    border-radius: 11px;
    padding: 13px 14px;
    color: var(--bone);
    font-family: inherit;
    line-height: normal;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}
.authpage .choice:hover { border-color: var(--faint); }
.authpage .choice.is-on {
    border-color: var(--flame);
    background: linear-gradient(150deg, rgba(255, 122, 24, 0.13), transparent 70%);
}
.authpage .choice .t {
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.authpage .choice .d {
    display: block;
    font-size: 11.5px;
    color: var(--smoke);
    margin-top: 4px;
    line-height: 1.45;
}
.authpage .tick {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.4px solid var(--edge);
    flex: 0 0 auto;
    position: relative;
}
.authpage .choice.is-on .tick { border-color: var(--flame); background: var(--heat); }

/* Language chips. */
.authpage .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.authpage .chip {
    background: var(--ash);
    border: 1px solid var(--edge);
    border-radius: 100px;
    padding: 7px 13px;
    font-family: inherit;
    font-size: 12.5px;
    line-height: normal;
    color: var(--smoke);
    cursor: pointer;
    transition: 0.18s;
}
.authpage .chip.is-on {
    border-color: var(--flame);
    color: var(--bone);
    background: linear-gradient(150deg, rgba(255, 122, 24, 0.16), transparent);
}

/* Consent blocks: one decision each, so each can be refused on its own. */
.authpage .consent {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    background: var(--ash);
    border: 1px solid var(--edge);
    border-radius: 11px;
    padding: 13px;
    margin-bottom: 9px;
    cursor: pointer;
    transition: border-color 0.18s;
}
.authpage .consent:hover { border-color: var(--faint); }
.authpage .consent:has(input:checked) { border-color: var(--flame); }

.authpage .consent input {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    border: 1.5px solid var(--edge);
    border-radius: 5px;
    background: none;
    position: relative;
    cursor: pointer;
    transition: 0.18s;
}
.authpage .consent input:checked { border-color: var(--flame); background: var(--heat); }
.authpage .consent input:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #1a0b04;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.authpage .consent .txt { font-size: 12.5px; line-height: 1.5; color: var(--smoke); }
.authpage .consent .txt b {
    color: var(--bone);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}
.authpage .consent a { color: var(--flame); }

/* The six-box code row. */
.authpage .otprow { display: flex; gap: 9px; margin-bottom: 6px; }
.authpage .otprow .authinput {
    width: 100%;
    text-align: center;
    font-family: var(--mono);
    font-size: 20px;
    padding: 13px 0;
    letter-spacing: 0.05em;
}

/* Back / Continue sit side by side. */
.authpage .actions { display: flex; gap: 10px; margin-top: 22px; }
.authpage .actions .authbtn { flex: 1; margin-top: 0; }
.authpage .authbtn--ghost {
    flex: 0 0 auto;
    background: none;
    border: 1px solid var(--edge);
    color: var(--bone);
    font-weight: 500;
    padding: 13px 18px;
}
.authpage .authbtn--ghost:hover { filter: none; background: var(--ash2); }

/* The under-18 notice. */
.authpage .authnotice .h {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--filament);
    margin-bottom: 6px;
}
.authpage .authnotice p { margin: 0; font-size: 12.5px; color: var(--smoke); line-height: 1.5; }

/* One step at a time. */
.authpage .step { display: none; }
.authpage .step.is-on { display: block; animation: auth-step 0.34s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes auth-step {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .authpage .step.is-on { animation: none; } }

@media (max-width: 420px) {
    .authpage .choices--two { grid-template-columns: 1fr; }
}
