/* Outside the site: the home page, logging in and asking for an account
   (templates/outside.html). Dark, with the brand's blue glowing from the
   top left, so it never looks like the application inside. */

body.cms-public {
    --out-bg: #0a1424;
    --out-text: #d6e0f0;
    --out-muted: #8fa2bf;
    color: var(--out-text);
    background:
        radial-gradient(60% 55% at 12% 0%, color-mix(in srgb, var(--brand-primary) 38%, transparent), transparent 72%),
        radial-gradient(45% 45% at 100% 100%, color-mix(in srgb, var(--brand-primary) 16%, transparent), transparent 70%),
        var(--out-bg);
    background-attachment: fixed;
}

/* Header: on the background, not a bar of its own. */
.cms-public .site-header {
    position: static;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
}
.cms-public .site-brand,
.cms-public .site-brand__name { color: #fff; }
.cms-public .site-nav a { color: var(--out-text); }
.cms-public .site-nav a:hover { color: #fff; }
.cms-public .lang-switch__opt { color: var(--out-muted); }
.cms-public .site-nav .lang-switch .lang-switch__opt.is-active { color: #fff; background: rgba(255, 255, 255, .12); }
.cms-public .site-nav-toggle span { background: #fff; }

/* Footer: one discreet line. */
.cms-public .site-footer {
    padding-block: .9rem;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.cms-public .site-footer__inner { display: none; }
.cms-public .site-footer__legal { margin-block: 0; color: var(--out-muted); }
.cms-public .site-footer__madewith a { color: #9cc3ff; }

/* Messages the shell shows under the header. */
.cms-public .site-flashes { padding-block: 1rem 0; }
.cms-public .site-flashes .alert { color: #1b2433; }

/* ── The home page ──────────────────────────────────────────────────── */
.cms-public .block-hero {
    background: transparent;
    border-bottom: 0;
    padding-block: 3rem;
}
body.cms-public:has(.hero--home) .block-hero {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
}
body.cms-public:has(.hero--home) .block-hero > .container { width: 100%; }
body.cms-public:has(.hero--home) .site-main { flex: 0 0 auto; }
.cms-public .hero-title { color: #fff; margin-bottom: .25em; }
.cms-public .hero-subtitle { color: var(--out-text); }
.cms-public .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); background: transparent; }
.cms-public .btn-ghost:hover { color: #fff; border-color: #fff; }
.cms-public .hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ── Logging in and asking for an account ───────────────────────────── */
.cms-public .site-main .section { padding-block: 1.5rem; }
.cms-public .form-page {
    color: #1b2433;
    background: #fff;
    padding: 2rem 2.25rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.cms-public .form-page h1 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.cms-public .form-page .alert { margin: 0 0 1.25rem; }
.cms-public .form-page .form-field { margin-bottom: 1rem; }
.cms-public .form-page .form-text { margin: .3rem 0 0; color: #5d6b82; font-size: .82rem; }
.cms-public .form-page .form-required { color: var(--brand-danger, #b3261e); }
.cms-public .form-page p { margin: 0 0 1rem; }
.cms-public .form-page p:last-child { margin-bottom: 0; }
.cms-public .form-page input[type="submit"] { margin-bottom: 1rem; }
/* «Show password»: a small link with room above it, not a grey button
   stuck to the bottom of the field. */
.cms-public .form-page .splent-reveal {
    display: inline-block;
    margin-top: .45rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand-primary);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
}
.cms-public .form-page .splent-reveal:hover { text-decoration: underline; }
.cms-public .form-page .splent-reveal + .form-text { margin-top: .15rem; }

/* A long form (four fields or more) in two columns, so it fits without
   scrolling: the short fields side by side, a text area, a checkbox and
   everything that is not a field across both. */
.cms-public .form-page:has(form > div.form-field:nth-of-type(4)) { max-width: 40rem; }
@media (min-width: 640px) {
    .cms-public .form-page form:has(> div.form-field:nth-of-type(4)) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 1rem;
        align-items: start;
    }
    .cms-public .form-page form:has(> div.form-field:nth-of-type(4)) > * { grid-column: 1 / -1; }
    .cms-public .form-page form:has(> div.form-field:nth-of-type(4)) > .form-field:not(:has(textarea, .form-check-input)) {
        grid-column: auto;
    }
    .cms-public .form-page textarea.form-control { min-height: 0; height: 4.5rem; resize: vertical; }
}

/* The column beside the form: what the site is for. */
.outside-pitch { padding: 2rem 1.25rem; }
.outside-pitch__inner { max-width: 30rem; }
.outside-pitch .pitch-eyebrow {
    margin: 0 0 .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .78rem;
    font-weight: 700;
    color: #9cc3ff;
}
.outside-pitch .pitch-title {
    margin: 0 0 1.5rem;
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.15;
}
.outside-pitch .pitch-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.outside-pitch .pitch-points li { padding-left: 1.1rem; border-left: 2px solid color-mix(in srgb, var(--brand-primary) 70%, #fff); line-height: 1.45; }
.outside-pitch .pitch-points b { color: #fff; }
.outside-pitch .node-states { justify-content: flex-start; margin: 1.75rem 0 0; }

@media (min-width: 900px) {
    body.cms-public:has(.outside-pitch) {
        display: grid;
        /* The two columns share the width of the header's container, so
           the form never runs past the right edge of the bar above it. */
        --out-half: calc(min(var(--brand-container, 1120px), 100vw) / 2);
        grid-template-columns: minmax(0, 1fr) minmax(0, var(--out-half)) minmax(0, var(--out-half)) minmax(0, 1fr);
        grid-template-rows: auto auto 1fr auto;
    }
    body.cms-public:has(.outside-pitch) > * { grid-column: 1 / -1; }
    body.cms-public:has(.outside-pitch) > .site-header { grid-row: 1; }
    body.cms-public:has(.outside-pitch) > .site-flashes { grid-row: 2; }
    body.cms-public:has(.outside-pitch) > .outside-pitch {
        grid-column: 2; grid-row: 3;
        display: flex; align-items: center; justify-content: flex-start;
        padding: 2rem clamp(1.5rem, 4vw, 3.5rem) 2rem 1.25rem;
    }
    body.cms-public:has(.outside-pitch) > .site-main {
        grid-column: 3; grid-row: 3;
        display: flex; align-items: center;
        padding-inline: 0 1.25rem;
    }
    body.cms-public:has(.outside-pitch) > .site-main > .section { margin: 0; padding-inline: 0; width: 100%; }
    body.cms-public:has(.outside-pitch) > .site-footer { grid-row: 4; }
}

/* On a phone the form comes first and the pitch after it. */
@media (max-width: 899px) {
    body.cms-public:has(.outside-pitch) > .outside-pitch { order: 1; }
    body.cms-public:has(.outside-pitch) > .site-footer { order: 2; }
}
