/* Customer auth pages — the two-panel shell inside layouts.public (header and
   footer around it) since 2026-09-01; it owned the viewport under AdminLTE
   before that. Colors come from the brand tokens: the accent hue is decoration
   on the dark panel, the AA link token is text on the light card, and the AA
   fill pair is the submit button — Slinky Pink under white text was 3.58:1. */

.auth-shell {
    --auth-accent: var(--brand-primary);
    --auth-accent-hover: var(--brand-primary-hover);
    --auth-accent-text: var(--brand-link);
    --auth-fill: var(--brand-primary-fill);
    --auth-fill-hover: var(--brand-primary-fill-hover);
    --auth-fill-ink: var(--brand-on-primary);
    --auth-ink: #171317;
    --auth-muted: #69676b;
    --auth-border: #dedbd7;
    display: grid;
    grid-template-columns: minmax(21rem, 43%) minmax(0, 57%);
    min-height: 40rem;
    color: #171717;
}

.auth-shell--mm {
    --auth-ink: #081728;
}

.auth-story {
    /* The anchor for the decorative ::before/::after rings. Dropping the old
       `position: sticky` without this sent them out over the form card. */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 4vw, 4.5rem);
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.13) 0 0.35rem, transparent 0.4rem),
        linear-gradient(145deg, var(--auth-ink), #050505);
    color: #ffffff;
}

.auth-shell--mm .auth-story {
    background:
        radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.15) 0 0.35rem, transparent 0.4rem),
        linear-gradient(145deg, #0a1b2f, #020912);
}

.auth-story::before,
.auth-story::after {
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    content: '';
}

.auth-story::before {
    right: -18rem;
    bottom: -11rem;
    width: 42rem;
    height: 42rem;
    box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.025), 0 0 0 9rem rgba(255, 255, 255, 0.02);
}

.auth-story::after {
    right: 15%;
    bottom: 28%;
    width: 5.5rem;
    height: 5.5rem;
    border: 1.25rem solid var(--auth-accent);
    opacity: 0.9;
}

.auth-story__content {
    max-width: 32rem;
    margin: 5rem 0;
}

.auth-story__eyebrow,
.auth-card__eyebrow {
    margin: 0 0 1rem;
    color: var(--auth-accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-card__eyebrow {
    color: var(--auth-accent-text);
}

.auth-story__title {
    max-width: 9ch;
    margin: 0;
    font-size: clamp(3.25rem, 6vw, 6.75rem);
    font-weight: 900;
    letter-spacing: -0.065em;
    line-height: 0.88;
}

.auth-story__copy {
    max-width: 27rem;
    margin: 2rem 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    line-height: 1.65;
}

.auth-story__footer {
    margin: 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-main {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 6vw, 6rem);
    background:
        linear-gradient(rgba(23, 23, 23, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 23, 23, 0.025) 1px, transparent 1px),
        #f7f6f3;
    background-size: 2.5rem 2.5rem;
}

.auth-card {
    width: min(100%, 29rem);
}

.auth-card--register {
    width: min(100%, 34rem);
    padding-block: 2rem;
}

.auth-card__heading {
    margin-bottom: 2.2rem;
}

.auth-card__heading h1 {
    margin: 0;
    color: #171717;
    font-size: clamp(2.25rem, 4vw, 3.35rem);
    font-weight: 850;
    letter-spacing: -0.055em;
    line-height: 1;
}

.auth-card__heading > p:last-child {
    margin: 0.85rem 0 0;
    color: var(--auth-muted);
    font-size: 1rem;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid #a7d9b4;
    border-radius: 0.5rem;
    background: #edf9f0;
    color: #155c2a;
    font-size: 0.9rem;
}

/* Magic-link: the same shape as .auth-alert in a neutral colour. The
   base alert is green because it only ever carried "we sent it" — an expired
   sign-in link is not bad news, but it is not success either. */
.auth-alert--notice {
    border-color: #d9cfa7;
    background: #fbf7ea;
    color: #6b5a17;
}

.magic-link__form {
    margin: 0;
}

.auth-form {
    display: grid;
    gap: 1.2rem;
}

.auth-name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-field {
    min-width: 0;
}

.auth-field > label,
.auth-field__label-row label {
    display: inline-block;
    margin: 0 0 0.45rem;
    color: #29282a;
    font-size: 0.84rem;
    font-weight: 750;
}

.auth-field__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.auth-field__label-row a,
.auth-card__switch a {
    color: #4f4c50;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration-color: color-mix(in srgb, var(--auth-accent) 70%, transparent);
    text-underline-offset: 0.22rem;
}

.auth-field__label-row a:hover,
.auth-card__switch a:hover {
    color: #171717;
    text-decoration-color: var(--auth-accent);
}

.auth-control {
    display: grid;
    grid-template-columns: 2.9rem minmax(0, 1fr);
    min-height: 3.35rem;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.82);
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-control--password {
    grid-template-columns: 2.9rem minmax(0, 1fr) 3.35rem;
}

.auth-control:focus-within {
    border-color: var(--auth-accent);
    background: #ffffff;
    box-shadow: 0 0 0 0.23rem color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

.auth-control--invalid {
    border-color: #b42318;
}

.auth-control__icon {
    display: grid;
    place-items: center;
    color: #8a878b;
    font-size: 0.9rem;
}

.auth-control input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #171717;
    font: inherit;
}

.auth-control input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
}

.auth-control__password-toggle {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-left: 1px solid color-mix(in srgb, var(--auth-border) 70%, transparent);
    background: transparent;
    color: #777478;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 150ms ease, color 150ms ease;
}

.auth-control__password-toggle:hover {
    background: color-mix(in srgb, var(--auth-accent) 7%, transparent);
    color: var(--auth-accent-text);
}

.auth-control__password-toggle:focus-visible {
    z-index: 1;
    outline: 3px solid color-mix(in srgb, var(--auth-accent) 35%, transparent);
    outline-offset: -0.3rem;
}

.auth-field__hint,
.auth-field__error {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.auth-field__hint {
    color: var(--auth-muted);
}

.auth-field__error {
    color: #b42318;
    font-weight: 650;
}

.auth-check {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.65rem;
    color: #4f4c50;
    cursor: pointer;
    font-size: 0.88rem;
}

.auth-check input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--auth-accent);
}

.auth-consent {
    padding: 1rem;
    border: 1px solid var(--auth-border);
    border-left: 0.25rem solid var(--auth-accent);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.72);
}

.auth-check--consent {
    width: 100%;
    align-items: flex-start;
    color: #29282a;
    line-height: 1.5;
}

.auth-check--consent input {
    flex: 0 0 auto;
    margin-top: 0.18rem;
}

.auth-consent__note {
    margin: 0.65rem 0 0 1.7rem;
    color: var(--auth-muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.auth-submit {
    display: flex;
    min-height: 3.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
    padding: 0.9rem 1.15rem;
    border: 1px solid var(--auth-fill);
    border-radius: 0.55rem;
    background: var(--auth-fill);
    color: var(--auth-fill-ink);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.015em;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.auth-submit:hover {
    border-color: var(--auth-fill-hover);
    background: var(--auth-fill-hover);
    color: var(--auth-fill-ink);
    transform: translateY(-1px);
}

.auth-submit:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--auth-accent) 35%, transparent);
    outline-offset: 0.2rem;
}

.auth-card__switch {
    margin: 1.75rem 0 0;
    color: var(--auth-muted);
    font-size: 0.88rem;
    text-align: center;
}

.auth-card__aside-action {
    margin: 1rem 0 0;
}

.auth-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: #4f4c50;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--auth-accent) 70%, transparent);
    text-underline-offset: 0.22rem;
}

.auth-link-button:hover {
    color: #171717;
    text-decoration-color: var(--auth-accent);
}

.auth-link-button:disabled {
    color: var(--auth-muted);
    cursor: default;
    text-decoration: none;
}

@media (max-width: 62rem) {
    .auth-shell {
        grid-template-columns: minmax(18rem, 36%) minmax(0, 64%);
    }

    .auth-story__title {
        font-size: clamp(3rem, 6vw, 4.75rem);
    }

    .auth-story::after {
        right: 7%;
    }
}

@media (max-width: 47.99rem) {
    .auth-shell {
        display: block;
        min-height: 0;
    }

    .auth-story {
        display: none;
    }

    .auth-main {
        align-items: flex-start;
        padding: 2rem 1.25rem 3rem;
    }

    .auth-card,
    .auth-card--register {
        width: min(100%, 34rem);
        padding-block: 0;
    }
}

@media (max-width: 31rem) {
    .auth-name-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .auth-card__heading h1 {
        font-size: 2.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell *,
    .auth-shell *::before,
    .auth-shell *::after {
        transition-duration: 0.01ms !important;
    }
}

/* An installed home-screen app (2026-10-26): the emailed link opens in the
   phone's browser, not in the app, so inside the app the magic-link page leads
   with the 6-digit code instead. */
.auth-copy--app {
    display: none;
}

@media (display-mode: standalone) {
    .auth-copy--app {
        display: inline;
    }

    .auth-copy--browser {
        display: none;
    }
}
