/* Sign-in pages (#812, #884): the frame of the signed-out Razor Pages, Login to Closed, laid out by
   Pages/Account/_SignInLayout.cshtml. Design B3 on the Entry Screen Options canvas. The kit in
   app.css draws the fields, buttons and messages; this file holds the frame and the few pieces the kit has no class for.
   Tokens only, never a hex. */

.sign-in {
    min-height: 100vh;
    display: flex;
}

/* The kit's flex display would otherwise beat the hidden attribute: the error box sign-in-forms.js fills, the guardian
   section About you shows for under 16s. */
.sign-in [hidden] {
    display: none;
}

/* ---- Brand panel: Logo2, the sport line-up on its ground line, the slogan --------------------------------------- */

/* Follows the theme like the rest of the app: the sport images have transparent backgrounds and see-through web lines
   and shadows (#879), so they sit straight on the dark surface too. */
.sign-in__brand {
    flex: 1 1 560px;
    min-width: 0;
    padding: 56px 64px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background: var(--hwc-surface);
}

.sign-in__logo img {
    display: block;
    height: 60px;
    width: auto;
}

.sign-in__showcase {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

/* The figures stand on a hairline ground. They shrink together rather than wrap. */
.sign-in__lineup {
    width: 100%;
    max-width: 680px;
    padding-bottom: 2px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    border-bottom: 1px solid var(--hwc-control-line);
}

/* sign-in-lineup.js swaps the picture while the figure is out: down and invisible, then back up. The timing matches
   the script's FADE. */
.sign-in__figure {
    flex: 0 1 156px;
    min-width: 0;
    width: 156px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    transition: opacity 450ms ease, transform 450ms ease;
}

.sign-in__figure.is-out {
    opacity: 0;
    transform: translateY(8px);
}

.sign-in__figure.is-missing {
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .sign-in__figure {
        transition: none;
    }
}

.sign-in__slogan {
    margin: 0;
    max-width: 480px;
    font-size: 26px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    color: var(--hwc-text-2);
}

.sign-in__balance {
    height: 60px;
}

/* ---- Form column ------------------------------------------------------------------------------------------- */

.sign-in__main {
    flex: 1 1 480px;
    min-width: 0;
    padding: 56px 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-in__column {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sign-in__title {
    margin: 0;
    font-size: var(--hwc-fs-title);
    font-weight: 700;
    line-height: 1.15;
}

.sign-in__intro,
.sign-in__note {
    margin: 0;
    font-size: var(--hwc-fs-body);
    line-height: 1.5;
    color: var(--hwc-text-muted);
    overflow-wrap: anywhere;
}

.sign-in__title + .sign-in__intro,
.sign-in__intro + .sign-in__intro {
    margin-top: -8px;
}

.sign-in__intro strong,
.sign-in__note strong {
    color: var(--hwc-text);
}

.sign-in__note--quiet {
    font-size: var(--hwc-fs-meta);
}

.sign-in__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Google and Apple, one above the other. */
.sign-in__form--providers {
    gap: 12px;
}

/* A heading or instruction held close to what it is about. */
.sign-in__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Reserves the widget's height so the button does not jump when Turnstile finishes loading. */
.sign-in__turnstile {
    min-height: 65px;
}

/* The resend form's widget is invisible unless Cloudflare wants an interactive check, so the form takes no room until
   then. */
.sign-in__resend {
    margin-top: -20px;
}

.sign-in__resend iframe {
    margin-top: 20px;
}

.sign-in__code {
    letter-spacing: 0.4em;
    font-variant-numeric: tabular-nums;
}

/* Text buttons ("Send a new code", "Keep my account"): 44px targets, their text lined up with the column's edges. */
.sign-in__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 16px;
    margin: -8px -8px 0;
}

/* A busy text button keeps its colour, as the busy primary does (#724). */
.hwc-link-button.is-busy:disabled {
    color: var(--hwc-action);
}

.sign-in__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--hwc-fs-meta);
    color: var(--hwc-text-muted);
}

.sign-in__divider::before,
.sign-in__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hwc-hairline);
}

.sign-in__terms {
    margin: 0;
    font-size: var(--hwc-fs-meta);
    line-height: 1.5;
    color: var(--hwc-text-muted);
}

.sign-in__switch {
    margin: 8px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--hwc-hairline);
    font-size: var(--hwc-fs-row);
    color: var(--hwc-text-2);
}

/* Links inside sentences stay underlined: the blue alone is too close to the grey text around it. */
.sign-in__main a:not([class]) {
    color: var(--hwc-action);
}

.sign-in__main a:not([class]):hover {
    color: var(--hwc-action-hover);
}

/* Orange is the only accent around the call to action (#884): the way to the other form is an orange link, and the
   terms are underlined in the text's own grey. */
.sign-in__main .sign-in__switch a {
    color: var(--hwc-cta-link);
    font-weight: 700;
}

.sign-in__main .sign-in__switch a:hover {
    color: var(--hwc-cta-pressed);
}

.sign-in__main .sign-in__terms a,
.sign-in__main .sign-in__terms a:hover {
    color: inherit;
}

/* ---- About you ----------------------------------------------------------------------------------------------- */

.sign-in__question {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.sign-in__question legend {
    padding: 0;
    margin-bottom: 2px;
    font-size: var(--hwc-fs-meta);
    font-weight: 600;
    color: var(--hwc-text-muted);
}

.sign-in__guardian {
    gap: 16px;
}

.sign-in__guardian p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--hwc-text-2);
}

/* ---- Close your account: what is removed --------------------------------------------------------------------- */

.sign-in__lead {
    margin: 0;
    font-size: var(--hwc-fs-row);
    font-weight: 700;
}

.sign-in__impact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sign-in__impact strong {
    font-variant-numeric: tabular-nums;
}

/* ---- Phone and narrow tablet: the panel above the form, the images in a strip (S2) --------------------------- */

@media (max-width: 900px) {
    .sign-in {
        flex-direction: column;
    }

    /* Its content lines up with the 400px form column below once there is room either side. */
    .sign-in__brand {
        flex: none;
        padding: 28px max(24px, calc((100% - 400px) / 2)) 24px;
        justify-content: flex-start;
        gap: 16px;
    }

    .sign-in__logo img {
        height: 40px;
    }

    .sign-in__showcase {
        gap: 16px;
    }

    /* Three across, as on the phones; the script rotates only the figures on screen. */
    .sign-in__lineup {
        gap: 8px;
    }

    .sign-in__figure {
        flex-basis: 100px;
        width: 100px;
    }

    .sign-in__figure:nth-child(n + 4) {
        display: none;
    }

    .sign-in__slogan {
        max-width: 300px;
        font-size: 18px;
    }

    .sign-in__balance {
        display: none;
    }

    .sign-in__main {
        flex: 1 0 auto;
        padding: 28px 24px 40px;
        align-items: flex-start;
    }

    .sign-in__column {
        gap: 18px;
    }

    .sign-in__title {
        font-size: 26px;
    }

    .sign-in__resend {
        margin-top: -18px;
    }
}

/* One above the other on a phone: side by side, the wider busy label ("Sending code…") would push the other button
   onto a new line under the person's finger. */
@media (max-width: 614px) {
    .sign-in__links {
        flex-direction: column;
        align-items: flex-start;
    }
}
