/* ==========================================================================
   Auth pages (/login, /register) — loaded only there, via AuthController's
   pageStyles, after brand.css. Everything is scoped under .auth (or under
   body:has(.auth) for the layout and chrome) so nothing leaks into the app's
   other pages, which keep app.css alone.

   Direction: a split screen. The form is small — five short fields at most —
   and centred alone on a page it left most of the viewport as unexplained
   background. So one half becomes the brand panel, carrying the same night
   field, the same blurred smoke shot and the same pink-to-blue seam the
   landing page uses, and the form sits on paper in the other half. The two
   fields are the landing page's own two fields, which is what makes the
   pages read as one product rather than two.

   All copy here is existing translated keys — nothing new was invented, so
   nothing renders in English for the other 35 locales.
   ========================================================================== */

body:has(.auth) {
    /* The split runs edge to edge, so <main class="container">'s 880px cap and
       gutter are handed back for these two pages only. Doing it here beats a
       100vw/negative-margin escape: no horizontal overflow to clip, and the
       panel's own edge is the page's edge. */
    background: var(--h-night);
}

body:has(.auth) main.container {
    max-width: none;
    padding: 0;
}

.auth {
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    /* A floor rather than a fixed height: the register form is a field taller
       than the login form and must be free to grow. The subtraction is the
       chrome's share of the viewport (masthead plus footer, ~11rem measured,
       with slack) so the split reaches the footer and the page doesn't scroll.
       It was capped at 46rem at first, which on a tall window left a slab of
       night below the footer where the panel had stopped early. */
    min-height: 30rem;
    min-height: max(30rem, calc(100svh - 13rem));
    font-family: var(--h-body);
    color: var(--h-ink);
}

/* --------------------------------------------------------------------------
   Brand panel — the same night field and the same smoke as the landing hero.
   -------------------------------------------------------------------------- */

.auth-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.4rem;
    padding: clamp(2.5rem, 5vw, 4.5rem);
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(58% 66% at 88% 8%, rgba(88, 167, 232, 0.24), transparent 62%),
        radial-gradient(60% 66% at 4% 94%, rgba(242, 120, 159, 0.26), transparent 62%),
        linear-gradient(168deg, var(--h-night-3), var(--h-night) 72%);
    color: var(--h-cream);
}

/* The smoke is decoration, so it's a background rather than an <img> — which
   also means the small-screen rule below, where the panel is dropped, keeps
   the 200KB photo from being fetched at all.
   Blurred harder than the landing page blurs the same shot, and dimmed
   further. There the photo spans the full width behind a headline and a card;
   here it's cropped to half a screen, which brings the couple up to the size
   of the type sitting on them — at the landing page's 3px they read as a
   second subject, with a face and two pairs of legs landing under the
   tagline. At this radius only the colour and drift of the smoke survives,
   which is all the panel is for. */
.auth-panel::before {
    content: '';
    position: absolute;
    /* Generous bleed: blur samples past its own edges, so a smaller inset
       leaves a visibly soft rim down the panel's hard right edge. */
    inset: -8%;
    z-index: -1;
    background-image: url('../img/marketing/hero-smoke-reveal.jpg');
    background-size: cover;
    background-position: 50% 42%;
    opacity: 0.34;
    filter: blur(11px) saturate(1.3);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.auth-brand img {
    width: clamp(2.6rem, 4vw, 3.4rem);
    height: auto;
    flex-shrink: 0;
}

.auth-brand span {
    font-family: var(--h-display);
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.auth-tagline {
    margin: 0;
    max-width: 30ch;
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
    line-height: 1.55;
    color: var(--h-cream);
}

/* The three hearts of the reveal game, in the seam's own colours: the pair
   that is always one pink and one blue, then the one that answers. Borrows
   .card-zone--heart from app.css purely for its mask — the sibling .card-zone
   class, which is what positions a real zone absolutely, is deliberately not
   applied. */
.auth-hearts {
    display: flex;
    gap: 0.7rem;
}

.auth-heart {
    width: 1.5rem;
    height: 1.5rem;
}

.auth-heart:nth-child(1) { background: var(--h-step-1); }
.auth-heart:nth-child(2) { background: var(--h-step-2); }
.auth-heart:nth-child(3) { background: var(--h-step-4); }

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

.auth-form-col {
    display: grid;
    place-items: center;
    padding: clamp(2.25rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 3rem);
    background: var(--h-paper);
}

.auth-form-inner {
    width: 100%;
    max-width: 24rem;
}

.auth h1 {
    margin: 0;
    font-family: var(--h-display);
    font-size: clamp(1.7rem, 2.6vw, 2.15rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--h-ink);
}

/* The page's one structural device, same as the landing page's section
   headings: the two answers a reveal can have. */
.auth h1::after {
    content: '';
    display: block;
    width: 56px;
    height: 5px;
    margin-top: 0.85rem;
    border-radius: 999px;
    background: var(--h-seam);
}

.auth form {
    margin-top: 1.75rem;
}

/* Labels, fields and the blush submit button come from brand.css, which the
   event pages share — only this page's layout for them lives here. */
.auth .btn-primary {
    display: block;
    width: 100%;
    margin-top: 1.75rem;
    padding: 0.9rem 1.5rem;
}

.auth .auth-switch {
    margin: 1.6rem 0 0;
    font-size: 0.92rem;
    color: var(--h-muted);
}

.auth .auth-switch a {
    color: var(--h-ink);
    font-weight: 600;
    text-decoration-color: var(--h-blush);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Flash messages are rendered by the page rather than the layout, so a failed
   login lands directly above the fields it refers to instead of in a bar over
   the whole split. See the note in login.php. */
.auth .flash {
    margin: 1.5rem 0 0;
    border-radius: 12px;
    font-size: 0.88rem;
}

.auth a:focus-visible,
.auth .btn-primary:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Responsive — below the breakpoint the panel is dropped rather than stacked.
   Stacked, it pushed the fields off a phone screen to show decoration the
   masthead is already carrying; dropped, the form is the first thing in view
   and the smoke photo is never requested.
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        display: none;
    }

    /* The min-height carries over deliberately, so the paper reaches the
       footer instead of stopping under the last line and leaving a band of
       night between the form and the footer. The form sits at the top of it
       rather than centred — on a phone, vertically centring a form that is
       nearly as tall as the viewport just pushes the submit button around. */
    .auth-form-col {
        align-content: start;
        padding-block: clamp(2rem, 8vw, 3rem);
    }
}

@media (max-width: 420px) {
    .auth-form-col { padding-inline: 1rem; }
    .auth form { margin-top: 1.5rem; }
}

/* The field and button transitions are stopped in brand.css, which owns
   them; this page adds no motion of its own. */
