/* GDPR cookie-consent banner + preferences modal.
   Styled with the platform theme variables so it adapts to each tenant's
   primary colour and to light/dark mode. Every var() has a literal fallback so
   the banner also renders correctly on the older event/RSVP templates that don't
   load the V2 styles.css variable set. */

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    display: none;
    padding: 1rem;
    background: rgb(var(--body-bg-rgb, 255, 255, 255));
    color: var(--default-text-color, #1a2638);
    border-top: 1px solid var(--default-border, rgba(0, 0, 0, .1));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .14);
}

.cc-banner.cc-show {
    display: block;
}

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.cc-banner-text {
    flex: 1 1 360px;
    min-width: 260px;
}

.cc-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .25rem;
    color: var(--default-text-color, #1a2638);
}

.cc-body {
    font-size: .8125rem;
    line-height: 1.5;
    margin: 0;
    color: var(--text-muted, #6c757d);
}

.cc-link {
    color: var(--primary-color, rgb(var(--primary-rgb, 84, 109, 254)));
    text-decoration: underline;
    white-space: nowrap;
}

.cc-banner-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Buttons — Accept and Reject share size/weight (equal prominence, GDPR). */
.cc-btn {
    font-size: .8125rem;
    font-weight: 500;
    padding: .5rem 1.1rem;
    border-radius: .4rem;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
}

.cc-btn-primary {
    background: var(--primary-color, rgb(var(--primary-rgb, 84, 109, 254)));
    border-color: var(--primary-color, rgb(var(--primary-rgb, 84, 109, 254)));
    color: #fff;
}

.cc-btn-primary:hover {
    opacity: .92;
}

/* Reject — equal prominence to Accept (same size + solid fill, neutral colour).
   Equal-prominence Accept/Reject is an ICO/CNIL requirement; only the tertiary
   Manage/Save actions stay in the lighter secondary style. */
.cc-btn-reject {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.cc-btn-reject:hover {
    opacity: .92;
}

.cc-btn-secondary {
    background: transparent;
    border-color: rgba(var(--primary-rgb, 84, 109, 254), .55);
    color: var(--primary-color, rgb(var(--primary-rgb, 84, 109, 254)));
}

.cc-btn-secondary:hover {
    background: rgba(var(--primary-rgb, 84, 109, 254), .08);
}

/* Preferences modal */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: none;
}

.cc-modal.cc-show {
    display: block;
}

.cc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
}

.cc-modal-dialog {
    position: relative;
    max-width: 560px;
    margin: 6vh auto;
    max-height: 88vh;
    overflow-y: auto;
    background: rgb(var(--body-bg-rgb, 255, 255, 255));
    color: var(--default-text-color, #1a2638);
    border-radius: .6rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
}

.cc-modal-header,
.cc-modal-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.25rem;
}

.cc-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--default-border, rgba(0, 0, 0, .1));
}

.cc-modal-header h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
}

.cc-modal-footer {
    justify-content: flex-end;
    flex-wrap: wrap;
    border-top: 1px solid var(--default-border, rgba(0, 0, 0, .1));
}

.cc-modal-close {
    background: none;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted, #6c757d);
}

.cc-modal-body {
    padding: .5rem 1.25rem 1rem;
}

.cc-cat {
    padding: .9rem 0;
    border-bottom: 1px solid var(--default-border, rgba(0, 0, 0, .08));
}

.cc-cat:last-child {
    border-bottom: 0;
}

.cc-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: .9rem;
}

.cc-cat p {
    margin: .35rem 0 0;
    font-size: .8125rem;
    line-height: 1.5;
    color: var(--text-muted, #6c757d);
}

/* Toggle switch */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(0, 0, 0, .25);
    border-radius: 24px;
    transition: background .2s;
}

.cc-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}

.cc-switch input:checked + .cc-slider {
    background: var(--primary-color, rgb(var(--primary-rgb, 84, 109, 254)));
}

.cc-switch input:checked + .cc-slider::before {
    transform: translateX(18px);
}

.cc-switch-locked .cc-slider {
    background: var(--primary-color, rgb(var(--primary-rgb, 84, 109, 254)));
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .cc-banner-actions {
        width: 100%;
    }

    .cc-banner-actions .cc-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}
