/* ==========================================================================
   BuyFreehold — cookie banner

   Loaded by all three layouts (public site, authentication, signed-in shell),
   so it defines its own tokens rather than depending on whichever stylesheet
   came with the page. Same palette as the rest of the site; self-contained, no
   external request, so the strict CSP needs nothing added.
   ========================================================================== */

.consent {
    --consent-surface: #ffffff;
    --consent-text: #101a28;
    --consent-muted: #5b6979;
    --consent-border: #d9dfe7;
    --consent-brand: #103156;
    --consent-brand-hover: #17416f;
    --consent-accent: #c9a227;

    position: fixed;
    /* Sits above everything, including the sticky site header. */
    z-index: 1000;
    inset: auto 0 0 0;
    padding: 1rem;
    /* Clear of the home indicator on a phone with a notch. */
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--consent-text);
    background: var(--consent-surface);
    border-top: 1px solid var(--consent-border);
    box-shadow: 0 -8px 32px -12px rgb(16 26 40 / 25%);
}

@media (prefers-color-scheme: dark) {
    .consent {
        --consent-surface: #16202d;
        --consent-text: #e8edf4;
        --consent-muted: #97a5b8;
        --consent-border: #253243;
        --consent-brand: #245a95;
        --consent-brand-hover: #2f6cae;

        box-shadow: 0 -8px 32px -12px rgb(0 0 0 / 70%);
    }
}

.consent__inner {
    display: grid;
    gap: 1rem;
    max-width: 72rem;
    margin-inline: auto;
}

.consent__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.consent__body p {
    margin: 0 0 0.5rem;
    color: var(--consent-muted);
    text-wrap: pretty;
}

.consent__more {
    margin-bottom: 0;
}

.consent__body a {
    color: var(--consent-brand);
    font-weight: 550;
    text-underline-offset: 0.2em;
    border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
    .consent__body a {
        color: var(--consent-accent);
    }
}

.consent__body a:focus-visible {
    outline: 3px solid var(--consent-accent);
    outline-offset: 2px;
}

/* Stacked and full width on a phone: both choices are equally easy to hit with
   a thumb, which is the point — a reject button that is harder to press than
   accept is a dark pattern whatever its colour. */
.consent__actions {
    display: grid;
    gap: 0.6rem;
    margin: 0;
}

.consent__button {
    min-height: 2.85rem;
    padding: 0.7rem 1.35rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.consent__button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(201 162 39 / 45%);
}

.consent__button--accept {
    color: #ffffff;
    background: var(--consent-brand);
    border-color: var(--consent-brand);
}

.consent__button--accept:hover {
    background: var(--consent-brand-hover);
}

/* Same size, same prominence, same weight — only the fill differs. */
.consent__button--reject {
    color: var(--consent-text);
    background: transparent;
    border-color: var(--consent-border);
}

.consent__button--reject:hover {
    background: rgb(16 26 40 / 5%);
}

@media (prefers-color-scheme: dark) {
    .consent__button--reject:hover {
        background: rgb(255 255 255 / 8%);
    }
}

@media (min-width: 48rem) {
    .consent {
        padding: 1.25rem 2rem;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }

    .consent__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 2.5rem;
    }

    .consent__actions {
        grid-auto-flow: column;
        align-items: center;
    }

    .consent__button {
        white-space: nowrap;
    }
}

/* The "change your choice" controls on the cookie policy page. Same buttons,
   in the flow of the document rather than fixed to the viewport. */
.consent-choice {
    --consent-text: #101a28;
    --consent-border: #d9dfe7;
    --consent-brand: #103156;
    --consent-brand-hover: #17416f;
    --consent-accent: #c9a227;

    display: grid;
    gap: 0.6rem;
    margin: 1.25rem 0;
}

@media (prefers-color-scheme: dark) {
    .consent-choice {
        --consent-text: #e8edf4;
        --consent-border: #253243;
        --consent-brand: #245a95;
        --consent-brand-hover: #2f6cae;
    }
}

@media (min-width: 34rem) {
    .consent-choice {
        grid-auto-flow: column;
        justify-content: start;
    }
}

@media (forced-colors: active) {
    .consent {
        border-top: 1px solid CanvasText;
    }

    .consent__button {
        border: 1px solid ButtonText;
    }
}

@media print {
    .consent {
        display: none !important;
    }
}
