/**
 * Flow Cookie Consent — self-contained styling.
 *
 * Deliberately depends on NO framework. The reference implementation this is abstracted
 * from was Tailwind utility classes plus FontAwesome icons; most of the sites it is being
 * rolled out to have neither, and a consent control that renders unstyled is a compliance
 * control the visitor cannot actually use.
 *
 * Everything is namespaced .flow-cc- and every property is set explicitly rather than
 * inherited, so a host site's own resets and global element styles cannot deform it.
 * Colours come from the CSS custom properties set on the root element, so a site matches
 * its palette from config rather than by editing markup.
 */

.flow-cc,
.flow-cc *,
.flow-cc *::before,
.flow-cc *::after {
    box-sizing: border-box;
}

.flow-cc {
    --flow-cc-bg: #ffffff;
    --flow-cc-fg: #1f2937;
    --flow-cc-muted: #6b7280;
    --flow-cc-line: #e5e7eb;
    --flow-cc-accent: #1a56db;
    --flow-cc-accent-text: #ffffff;
    --flow-cc-radius: 12px;
    --flow-cc-z: 2147483000;

    /* Absolute units throughout, and an explicit base size here.
       Host sites vary wildly: this one sets `html { font-size: 62.5% }` (the old 10px-root
       trick), which silently rendered this banner at 60% — 8.75px body copy on a compliance
       notice the visitor has to read. `rem` inherits that; `px` cannot. Browser zoom still
       scales the whole thing, so nothing is lost. */
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
}

.flow-cc [hidden] {
    display: none !important;
}

.flow-cc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flow-cc-locked {
    overflow: hidden;
}

/* ── Banner ─────────────────────────────────────────────────────────────── */

.flow-cc-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: var(--flow-cc-z);
    width: calc(100% - 48px);
    max-width: 384px;
    padding: 24px;
    background: var(--flow-cc-bg);
    color: var(--flow-cc-fg);
    border-radius: var(--flow-cc-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .2), 0 8px 10px -6px rgba(0, 0, 0, .15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .3s ease, transform .3s ease;
}

.flow-cc-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.flow-cc-banner__heading {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

.flow-cc-banner__body {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--flow-cc-muted);
}

.flow-cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.flow-cc-banner__actions .flow-cc-btn {
    flex: 1 1 80px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.flow-cc-btn {
    display: inline-block;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.flow-cc-btn:focus-visible {
    outline: 2px solid var(--flow-cc-accent);
    outline-offset: 2px;
}

.flow-cc-btn--ghost {
    background: transparent;
    color: var(--flow-cc-fg);
    border-color: #9ca3af;
}

.flow-cc-btn--ghost:hover {
    background: #f9fafb;
}

.flow-cc-btn--outline {
    background: transparent;
    color: var(--flow-cc-accent);
    border-color: var(--flow-cc-accent);
}

.flow-cc-btn--outline:hover {
    background: rgba(0, 0, 0, .04);
}

.flow-cc-btn--solid {
    background: var(--flow-cc-accent);
    color: var(--flow-cc-accent-text);
    border-color: var(--flow-cc-accent);
}

.flow-cc-btn--solid:hover {
    opacity: .9;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */

.flow-cc-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--flow-cc-z) + 10);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .3s ease;
}

.flow-cc-modal.is-visible {
    opacity: 1;
}

.flow-cc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
}

.flow-cc-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 672px;
    max-height: 90vh;
    background: var(--flow-cc-bg);
    color: var(--flow-cc-fg);
    border-radius: var(--flow-cc-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
}

.flow-cc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid var(--flow-cc-line);
    flex-shrink: 0;
}

.flow-cc-modal__heading {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.flow-cc-modal__close {
    padding: 4px;
    background: none;
    border: 0;
    color: var(--flow-cc-muted);
    cursor: pointer;
    line-height: 0;
}

.flow-cc-modal__close:hover {
    color: #000;
}

.flow-cc-modal__body {
    flex: 1 1 auto;
    padding: 24px;
    overflow-y: auto;
}

.flow-cc-modal__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--flow-cc-line);
    flex-shrink: 0;
}

.flow-cc-modal__foot .flow-cc-btn {
    padding-left: 20px;
    padding-right: 20px;
}

.flow-cc-intro {
    margin: 0 0 8px;
    font-size: 14px;
    color: #374151;
}

.flow-cc-links {
    margin: 0 0 16px;
    font-size: 14px;
}

.flow-cc-link {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    color: var(--flow-cc-accent);
    text-decoration: underline;
    cursor: pointer;
}

.flow-cc-sep {
    margin: 0 8px;
    color: var(--flow-cc-muted);
}

/* ── Categories ─────────────────────────────────────────────────────────── */

.flow-cc-cat {
    padding: 16px 0 12px;
    border-top: 1px solid var(--flow-cc-line);
}

.flow-cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.flow-cc-cat__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.flow-cc-cat__name {
    font-weight: 700;
    color: #000;
}

.flow-cc-chevron {
    color: #9ca3af;
    transition: transform .2s ease;
}

.flow-cc-chevron.is-open {
    transform: rotate(90deg);
}

.flow-cc-cat__body {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--flow-cc-muted);
}

.flow-cc-always {
    font-size: 14px;
    font-weight: 600;
    color: var(--flow-cc-accent);
    white-space: nowrap;
}

/* ── Switch ─────────────────────────────────────────────────────────────── */

.flow-cc-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.flow-cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.flow-cc-switch__track {
    display: block;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 9999px;
    transition: background-color .2s ease;
}

.flow-cc-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 9999px;
    transition: transform .2s ease;
}

.flow-cc-switch input:checked + .flow-cc-switch__track {
    background: var(--flow-cc-accent);
}

.flow-cc-switch input:checked + .flow-cc-switch__track::after {
    transform: translateX(20px);
}

.flow-cc-switch input:focus-visible + .flow-cc-switch__track {
    outline: 2px solid var(--flow-cc-accent);
    outline-offset: 2px;
}

/* ── Cookie tables ──────────────────────────────────────────────────────── */

.flow-cc-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.flow-cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.flow-cc-table th,
.flow-cc-table td {
    padding: 4px 8px;
    border: 1px solid var(--flow-cc-line);
    text-align: left;
    vertical-align: top;
    color: var(--flow-cc-fg);
}

.flow-cc-table th {
    background: #f9fafb;
    font-weight: 600;
}

.flow-cc-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

/* ── Reopen trigger ─────────────────────────────────────────────────────── */

/* Inside the site's own footer: sits in the flow like any other footer link, and inherits
   the footer's colours rather than fighting them. */
.flow-cc-trigger--inline {
    background: none;
    border: 0;
    color: inherit;
    opacity: .85;
    padding: 4px 0;
    text-decoration: underline;
}

.flow-cc-trigger--inline:hover {
    opacity: 1;
    color: inherit;
}

/* Fallback for templates with no <footer> to place it in. */
.flow-cc-trigger--floating,
.flow-cc-trigger {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: calc(var(--flow-cc-z) - 10);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--flow-cc-bg);
    color: var(--flow-cc-fg);
    font-family: inherit;
    font-size: 12px;
    border: 1px solid var(--flow-cc-line);
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .15);
    cursor: pointer;
}

.flow-cc-trigger:hover {
    color: #000;
    border-color: #9ca3af;
}

/* --inline must win over the shared .flow-cc-trigger block above, which is written for the
   floating case. Declared after it so specificity ties resolve the right way. */
.flow-cc-trigger--inline {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 0;
    box-shadow: none;
}

.flow-cc-trigger-wrap--floating {
    position: static;
}

@media (max-width: 480px) {
    .flow-cc-banner {
        left: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
        padding: 20px;
    }

    .flow-cc-modal__head,
    .flow-cc-modal__body,
    .flow-cc-modal__foot {
        padding: 16px;
    }
}

/* Respect a visitor who has asked for less motion; the banner still appears. */
@media (prefers-reduced-motion: reduce) {
    .flow-cc-banner,
    .flow-cc-modal,
    .flow-cc-chevron,
    .flow-cc-switch__track,
    .flow-cc-switch__track::after {
        transition: none;
    }
}
