/*
 * Sign-in: a light ivory brand panel beside a paper sign-in side, in the website's calm theme (gold as the accent,
 * black only for text). Under 1024 px the panel becomes a band and the sign-in a sheet.
 * Colours and fonts come from tokens.css. Google is the only way in.
 */

* {
    box-sizing: border-box;
    margin: 0;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 58fr 42fr;
    background: var(--paper-50);
    color: var(--text-strong);
    font: var(--fs-body)/1.5 var(--font-text);
}

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ── The brand panel ── */

.panel {
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border);
    color: var(--text-strong);
    background: radial-gradient(120% 90% at 18% 12%, var(--paper-50) 0%, var(--paper-100) 55%, var(--gold-100) 100%);
}

.emblem {
    -webkit-mask: url(/images/logo-mark.svg) center / contain no-repeat;
    mask: url(/images/logo-mark.svg) center / contain no-repeat;
}

.panel .mark {
    position: absolute;
    top: 44px;
    left: 52px;
    width: 64px;
    aspect-ratio: 1;
    background: var(--accent-mark);
}

.panel .watermark {
    position: absolute;
    right: -12%;
    top: 50%;
    width: 62%;
    aspect-ratio: 1;
    transform: translateY(-50%);
    background: var(--gold-500);
    opacity: 0.14;
}

.panel .copy {
    position: absolute;
    left: 52px;
    right: 14%;
    bottom: 56px;
}

.eyebrow {
    font: 600 13px/1 var(--font-text);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-accent);
}

.panel h1 {
    margin-top: 14px;
    font: 700 clamp(40px, 4vw, 60px)/1.05 var(--font-brand);
}

.panel .rule {
    width: 88px;
    height: 1px;
    margin: 26px 0 20px;
    background: var(--gold-500);
}

.panel .lead {
    font-size: 17px;
    color: var(--text-muted);
}

/* ── The sign-in side ── */

.side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 8% 72px;
    background: var(--bg-surface);
}

.form {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.form h2 {
    font: 700 34px/1.15 var(--font-brand);
}

.subtitle {
    margin: 8px 0 28px;
    color: var(--text-muted);
    font-size: 16px;
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 52px;
    border: 1px solid var(--gold-500);
    background: var(--gold-500);
    color: var(--ink-950);
    text-decoration: none;
    font: 600 16px var(--font-text);
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.google-button:hover {
    border-color: var(--gold-600);
    background: var(--gold-600);
}

.google-button[aria-busy='true'] {
    opacity: 0.75;
    pointer-events: none;
}

.google-button .google-logo {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    flex: none;
}

.google-button svg {
    width: 18px;
    height: 18px;
}

.help {
    margin-top: 18px;
    color: var(--text-subtle);
    font-size: 14px;
}

.error {
    margin-top: 18px;
    padding: 10px 12px;
    border-left: 3px solid var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 14px;
}

.foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(24px + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--text-subtle);
    font-size: var(--fs-label);
}

/* ── Under 1024 px: the panel becomes a band, the sign-in a sheet (the phone view) ── */

@media (max-width: 1023px) {
    body {
        display: flex;
        flex-direction: column;
        background: var(--paper-100);
    }

    .panel {
        flex: none;
        min-height: 42vh;
        min-height: 42svh;
        border-right: 0;
    }

    .panel .mark {
        top: calc(28px + env(safe-area-inset-top));
        left: 24px;
        width: 40px;
    }

    .panel .watermark {
        right: -18%;
        top: 8%;
        width: 70%;
        transform: none;
    }

    .panel .copy {
        left: 24px;
        right: 24px;
        bottom: 44px;
    }

    .panel .rule,
    .panel .lead {
        display: none;
    }

    .panel h1 {
        margin-top: 10px;
        font-size: clamp(32px, 8vw, 44px);
    }

    .side {
        flex: 1;
        justify-content: flex-start;
        margin-top: -22px;
        border-radius: 20px 20px 0 0;
        padding: 36px 24px calc(80px + env(safe-area-inset-bottom));
        box-shadow: var(--shadow-sheet);
    }

    .form h2 {
        font-size: 28px;
    }
}
