/* Matthew (AI), 2026-09-15 11:35, styling for the first-party cookie-consent banner + preferences dialog that
 * replaces CookieYes. Everything is namespaced under .litzi-cc / #litzi-cc-* so it cannot collide with Bootstrap,
 * Telerik or sb-admin-2, all three of which are also on the page.
 *
 * Two deliberate design decisions worth not "fixing" later:
 *
 *  1. ACCEPT AND REJECT ARE VISUALLY IDENTICAL. Under GDPR, refusing consent has to be as easy as giving it, and
 *     regulators read a prominent "Accept" next to a faint "Reject" as a dark pattern that invalidates the consent.
 *     CookieYes rendered both in the same grey for exactly this reason. Same weight, same size, same colour, both
 *     on the first layer. "Customise" is the outlined one because it opens a dialog rather than deciding anything.
 *
 *  2. THE PALETTE IS SCOPED, NOT INHERITED. The tokens below are declared on the component rather than pulled from
 *     landing.css, because landing.css is only loaded on the landing page and this banner appears on all of them.
 *     The values match the Litzi brand vars (--dark / --primary) so it looks native either way.
 */

.litzi-cc {
    --cc-ink: #2d3436;
    --cc-ink-soft: #55606a;
    --cc-surface: #ffffff;
    --cc-surface-alt: #f7f7f5;
    --cc-line: #e2e4e6;
    --cc-action: #2d3436;
    --cc-action-ink: #ffffff;
    --cc-accent: #ff6b6b;
    --cc-focus: #0056a7;
    --cc-radius: 12px;
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--cc-ink);
    line-height: 1.5;
    box-sizing: border-box;
}

    .litzi-cc *,
    .litzi-cc *::before,
    .litzi-cc *::after {
        box-sizing: inherit;
    }

    /* Matthew (AI), 2026-09-15 11:35, the component's show/hide is the `hidden` attribute, driven from JS. The
       browser default for [hidden] is only `display:none` at user-agent weight, which loses to the `display:flex`
       this file sets on the modal, the revisit button and the accordion rows - so a "hidden" dialog would sit
       there fully visible. Forcing it here is what makes el.hidden = true actually mean hidden. */
    .litzi-cc [hidden] {
        display: none !important;
    }

/* Matthew (AI), 2026-09-15 11:35, one visible focus ring for the whole component. The site's global
   .btn:focus rule paints a white halo that disappears against the banner's white card, so it is overridden here. */
.litzi-cc :focus-visible {
    outline: 3px solid var(--cc-focus);
    outline-offset: 2px;
    box-shadow: none;
}

/* ============================================================================================================
   Banner (first layer)
   ============================================================================================================ */

#litzi-cc-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 99999998;
    background: var(--cc-surface);
    border-top: 1px solid var(--cc-line);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
    padding: 18px 20px;
    animation: litzi-cc-rise .28s ease-out;
}

@keyframes litzi-cc-rise {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.litzi-cc-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
}

.litzi-cc-copy {
    flex: 1 1 420px;
    min-width: 0;
}

    .litzi-cc-copy h2 {
        font-size: 1.05rem;
        font-weight: 700;
        margin: 0 0 4px;
        border-bottom: 0; /* site.css puts a pink rule under headings - not wanted inside a dialog */
        color: var(--cc-ink);
    }

    .litzi-cc-copy p {
        margin: 0;
        font-size: .9rem;
        color: var(--cc-ink-soft);
    }

    .litzi-cc-copy a {
        color: var(--cc-focus);
        text-decoration: underline;
    }

.litzi-cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 0 0 auto;
}

/* ============================================================================================================
   Buttons
   ============================================================================================================ */

.litzi-cc-btn {
    font: inherit;
    font-weight: 700;
    font-size: .875rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--cc-action);
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s ease, background-color .15s ease;
}

.litzi-cc-btn-solid {
    background: var(--cc-action);
    color: var(--cc-action-ink);
}

    .litzi-cc-btn-solid:hover {
        filter: brightness(1.35);
    }

.litzi-cc-btn-ghost {
    background: transparent;
    color: var(--cc-action);
}

    .litzi-cc-btn-ghost:hover {
        background: var(--cc-surface-alt);
    }

/* ============================================================================================================
   Overlay + preferences dialog (second layer)
   ============================================================================================================ */

#litzi-cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99999999;
}

#litzi-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none; /* the flex wrapper is only for centring; the card below takes the clicks */
}

.litzi-cc-card {
    pointer-events: auto;
    background: var(--cc-surface);
    border-radius: var(--cc-radius);
    width: 100%;
    max-width: 740px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .3);
    overflow: hidden;
}

.litzi-cc-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--cc-line);
}

    .litzi-cc-head h2 {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 0;
        flex: 1;
        border-bottom: 0;
    }

.litzi-cc-close {
    background: none;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    color: var(--cc-ink-soft);
    border-radius: 6px;
}

    .litzi-cc-close:hover {
        background: var(--cc-surface-alt);
        color: var(--cc-ink);
    }

.litzi-cc-body {
    padding: 16px 24px 4px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.litzi-cc-intro p {
    font-size: .875rem;
    color: var(--cc-ink-soft);
    margin: 0 0 10px;
}

.litzi-cc-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--cc-line);
    background: var(--cc-surface-alt);
}

/* Matthew (AI), 2026-09-15 11:35, stop the page behind the dialog scrolling when the wheel reaches the end of the
   dialog's own scroller. Set on <html> rather than <body> because Bootstrap modals already fight over body. */
.litzi-cc-locked {
    overflow: hidden;
}

/* ============================================================================================================
   Category accordions
   ============================================================================================================ */

.litzi-cc-cat {
    border: 1px solid var(--cc-line);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.litzi-cc-cat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--cc-surface);
}

.litzi-cc-acc-btn {
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--cc-ink);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: left;
}

    /* Chevron rotates to point down when the panel is open - the only affordance telling you the row expands. */
    .litzi-cc-acc-btn::before {
        content: '';
        width: 7px;
        height: 7px;
        border-right: 2px solid var(--cc-ink-soft);
        border-bottom: 2px solid var(--cc-ink-soft);
        transform: rotate(-45deg);
        transition: transform .18s ease;
        flex: 0 0 auto;
    }

    .litzi-cc-acc-btn[aria-expanded="true"]::before {
        transform: rotate(45deg);
    }

.litzi-cc-always {
    font-size: .8rem;
    font-weight: 700;
    color: #2b8a3e;
    white-space: nowrap;
}

.litzi-cc-cat-desc {
    padding: 0 14px 12px;
    font-size: .85rem;
    color: var(--cc-ink-soft);
}

    .litzi-cc-cat-desc p {
        margin: 0;
    }

.litzi-cc-cat-body {
    padding: 0 14px 14px;
    background: var(--cc-surface-alt);
    border-top: 1px solid var(--cc-line);
}

/* ============================================================================================================
   Toggle switch
   ============================================================================================================ */

.litzi-cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
}

    .litzi-cc-switch input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        opacity: 0; /* the real checkbox stays in the a11y tree and takes the clicks; the track below is decoration */
        cursor: pointer;
        z-index: 1;
    }

    .litzi-cc-switch .litzi-cc-track {
        position: absolute;
        inset: 0;
        background: #c3c8cc;
        border-radius: 999px;
        transition: background-color .18s ease;
        pointer-events: none;
    }

        .litzi-cc-switch .litzi-cc-track::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 18px;
            height: 18px;
            background: #fff;
            border-radius: 50%;
            transition: transform .18s ease;
            box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
        }

    .litzi-cc-switch input:checked ~ .litzi-cc-track {
        background: var(--cc-accent);
    }

        .litzi-cc-switch input:checked ~ .litzi-cc-track::after {
            transform: translateX(20px);
        }

    .litzi-cc-switch input:focus-visible ~ .litzi-cc-track {
        outline: 3px solid var(--cc-focus);
        outline-offset: 2px;
    }

/* ============================================================================================================
   Audit table (the cookie list inside each category)
   ============================================================================================================ */

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

.litzi-cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    min-width: 460px;
}

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

    .litzi-cc-table th {
        background: #eceeef;
        font-weight: 700;
        white-space: nowrap;
    }

    .litzi-cc-table td:first-child {
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        white-space: nowrap;
    }

.litzi-cc-empty {
    margin: 12px 0 0;
    font-size: .8rem;
    font-style: italic;
    color: var(--cc-ink-soft);
}

/* ============================================================================================================
   Revisit button - reopens preferences after a decision has been made
   ============================================================================================================ */

#litzi-cc-revisit {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 99999997; /* under the banner, over the page - Crisp chat sits bottom-right so they never overlap */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: #0056a7;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
    transition: transform .15s ease;
}

    #litzi-cc-revisit:hover {
        transform: scale(1.08);
    }

    #litzi-cc-revisit svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
    }

/* ============================================================================================================
   Placeholder shown in place of an iframe held back pending consent
   ============================================================================================================ */

.litzi-cc-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background: var(--cc-surface-alt);
    border: 1px dashed var(--cc-line);
    border-radius: 8px;
    font-size: .875rem;
    color: var(--cc-ink-soft);
}

/* ============================================================================================================
   Small screens
   ============================================================================================================ */

@media (max-width: 767.98px) {
    #litzi-cc-banner {
        padding: 16px;
        max-height: 82vh;
        overflow-y: auto;
    }

    .litzi-cc-actions {
        width: 100%;
    }

    .litzi-cc-btn {
        flex: 1 1 100%; /* full-width stacked buttons - equal size keeps accept and reject equally easy to hit */
    }

    .litzi-cc-foot .litzi-cc-btn {
        flex: 1 1 100%;
    }

    .litzi-cc-card {
        max-height: 92vh;
    }

    .litzi-cc-head,
    .litzi-cc-body,
    .litzi-cc-foot {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .litzi-cc,
    .litzi-cc *,
    #litzi-cc-banner,
    #litzi-cc-revisit {
        animation: none !important;
        transition: none !important;
    }
}
