/* ==========================================================================
   Cookie consent banner
   Non-blocking bottom bar, not a full-screen modal — see
   templates/element/CookieConsent/banner.php and
   webroot/js/cookie-consent.js.
   ========================================================================== */

.cookie-consent-banner {
    position: fixed;
    z-index: 4000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 720px;
    margin: 0 auto;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: var(--calendio-radius-xl, 24px);
    background: linear-gradient(180deg, #FFFFFF, var(--calendio-surface-warm, #FFFCF7));
    box-shadow: 0 20px 50px rgba(31, 35, 48, .18);
}

.cookie-consent-banner[hidden] {
    display: none;
}

.cookie-consent-banner__inner {
    padding: 20px 22px;
}

.cookie-consent-banner__summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cookie-consent-banner__text strong {
    display: block;
    margin-bottom: 6px;
    color: var(--calendio-ink, #1F2330);
    font-size: 15px;
    font-weight: 950;
    letter-spacing: -.01em;
}

.cookie-consent-banner__text p {
    margin: 0;
    color: var(--calendio-text-muted, #766E66);
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 600;
}

.cookie-consent-banner__policy-link {
    margin-top: 6px !important;
}

.cookie-consent-banner__policy-link a {
    color: var(--calendio-primary-hover, #5947E8);
    text-decoration: underline;
    font-weight: 700;
}

.cookie-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
    white-space: nowrap;
}

.cookie-consent-btn:hover {
    transform: translateY(-1px);
}

.cookie-consent-btn--primary {
    /*
     * --cookie-consent-accent is only ever set inline, on the banner
     * wrapper, when a tenant has their own accent_color_override (see
     * templates/element/CookieConsent/banner.php) — background falls
     * back to the usual two-tone Calendio gradient otherwise.
     */
    background: var(--cookie-consent-accent, linear-gradient(135deg, var(--calendio-primary, #6D5DF6), var(--calendio-pink, #F05BA8)));
    color: #FFFFFF;
    box-shadow: 0 12px 26px rgba(var(--calendio-primary-rgb, 109, 93, 246), .22);
}

.cookie-consent-btn--secondary {
    border-color: var(--calendio-border, #E8DED2);
    background: #FFFFFF;
    color: var(--calendio-ink, #1F2330);
}

.cookie-consent-btn--secondary:hover {
    border-color: var(--calendio-primary-border, #DCD7FF);
    color: var(--calendio-primary-hover, #5947E8);
}

.cookie-consent-btn--ghost {
    background: transparent;
    color: var(--calendio-text-muted, #766E66);
}

.cookie-consent-btn--ghost:hover {
    color: var(--calendio-primary-hover, #5947E8);
}

/* Details / customize view -------------------------------------------- */

.cookie-consent-banner__details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-consent-banner__details[hidden] {
    display: none;
}

.cookie-consent-banner__details-header strong {
    display: block;
    margin-bottom: 4px;
    color: var(--calendio-ink, #1F2330);
    font-size: 15px;
    font-weight: 950;
}

.cookie-consent-banner__details-header p {
    margin: 0;
    color: var(--calendio-text-muted, #766E66);
    font-size: 13px;
    font-weight: 600;
}

.cookie-consent-banner__categories {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.cookie-consent-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--calendio-border, #E8DED2);
    cursor: pointer;
}

.cookie-consent-category:last-child {
    border-bottom: none;
}

.cookie-consent-category__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cookie-consent-category__text strong {
    color: var(--calendio-ink, #1F2330);
    font-size: 13.5px;
    font-weight: 900;
}

.cookie-consent-category__text span {
    color: var(--calendio-text-muted, #766E66);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
}

.cookie-consent-toggle {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    width: 42px;
    height: 24px;
}

.cookie-consent-toggle input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cookie-consent-toggle input:disabled {
    cursor: default;
}

.cookie-consent-toggle__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--calendio-border-strong, #D8C8B8);
    transition: background .16s ease;
}

.cookie-consent-toggle__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(31, 35, 48, .25);
    transition: transform .16s ease;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle__track {
    background: var(--cookie-consent-accent, var(--calendio-primary, #6D5DF6));
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle__track::after {
    transform: translateX(18px);
}

.cookie-consent-toggle input:disabled + .cookie-consent-toggle__track {
    background: var(--calendio-primary-soft, #F0EEFF);
}

.cookie-consent-toggle input:disabled + .cookie-consent-toggle__track::after {
    background: var(--calendio-primary, #6D5DF6);
    transform: translateX(18px);
}

.cookie-consent-toggle input:focus-visible + .cookie-consent-toggle__track {
    outline: 2px solid var(--calendio-primary, #6D5DF6);
    outline-offset: 2px;
}

/* Reopen button --------------------------------------------------------- */

.cookie-consent-reopen {
    position: fixed;
    z-index: 3900;
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--calendio-text-muted, #766E66);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    box-shadow: var(--calendio-shadow-sm, 0 4px 14px rgba(17, 24, 39, .06));
    cursor: pointer;
}

.cookie-consent-reopen[hidden] {
    display: none;
}

.cookie-consent-reopen:hover {
    border-color: var(--calendio-primary-border, #DCD7FF);
    color: var(--calendio-primary-hover, #5947E8);
}

@media (max-width: 640px) {
    .cookie-consent-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .cookie-consent-banner__inner {
        padding: 16px 16px;
    }

    .cookie-consent-banner__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-btn {
        width: 100%;
    }

    .cookie-consent-reopen {
        left: 10px;
        bottom: 10px;
    }
}
