/* Cookie banner, preferences dialog and consent-gated embeds.
   Markup: layouts/site/cookie-consent.blade.php, site/partials/consent-embed.blade.php */

.cc-banner,
.cc-dialog,
.cc-embed {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: #3d4b5c;
}

/* ---------- Buttons ---------- */

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1.5px solid #d5dee8;
    border-radius: 999px;
    background: #fff;
    color: #0f1d2e;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}

.cc-btn:hover { border-color: #1577bb; color: #1577bb; }
.cc-btn--primary { background: #1577bb; border-color: #1577bb; color: #fff; }
.cc-btn--primary:hover { background: #0f5f97; border-color: #0f5f97; color: #fff; }
.cc-btn--link { border-color: transparent; background: none; color: #1577bb; padding: 0 8px; }
.cc-btn--link:hover { text-decoration: underline; }
.cc-btn:focus-visible,
.cc-close:focus-visible { outline: 3px solid #6fb4e6; outline-offset: 2px; }

/* ---------- Banner ---------- */

.cc-banner {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1040; /* above the header (1030) and the WhatsApp button (1020) */
    width: min(440px, calc(100% - 40px));
    padding: 22px 22px 20px;
    border: 1px solid rgba(15, 29, 46, .08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(10, 27, 48, .28);
    animation: cc-in .35s ease-out;
}

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

.cc-banner__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f1d2e;
}

.cc-banner__title i { color: #3fb24a; }

.cc-banner__text {
    margin: 10px 0 18px;
    font-size: 14px;
    line-height: 1.6;
}

.cc-banner__text a { color: #1577bb; text-decoration: underline; }

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

@keyframes cc-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Preferences dialog ---------- */

.cc-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(10, 27, 48, .4);
}

.cc-dialog::backdrop { background: rgba(10, 27, 48, .55); }

.cc-dialog__inner { padding: 26px 26px 22px; }

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

.cc-dialog__head h2 { margin: 0; font-size: 21px; font-weight: 800; color: #0f1d2e; }

.cc-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #0f1d2e;
    cursor: pointer;
}

.cc-dialog__intro { margin: 10px 0 18px; font-size: 14px; line-height: 1.6; }

.cc-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    border-top: 1px solid #e2e8f0;
}

.cc-option h3 { margin: 0; font-size: 15.5px; font-weight: 700; color: #0f1d2e; }
.cc-option h3 label { cursor: pointer; }
.cc-option p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; }

.cc-always {
    flex: none;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(63, 178, 74, .12);
    color: #2b8f35;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* toggle switch built on a real checkbox */
.cc-switch {
    position: relative;
    flex: none;
    width: 48px;
    height: 28px;
}

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

.cc-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #c9d4e0;
    transition: background-color .2s;
}

.cc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s;
}

.cc-switch input:checked + .cc-switch__track { background: #3fb24a; }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-switch__track { outline: 3px solid #6fb4e6; outline-offset: 2px; }

.cc-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

/* ---------- Consent-gated embeds ---------- */

.cc-embed { position: relative; }

.cc-embed__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    text-align: center;
    background:
        radial-gradient(circle at 1px 1px, rgba(21, 119, 187, .14) 1px, transparent 0) 0 0 / 14px 14px,
        #eef3f8;
}

.cc-embed__placeholder[hidden] { display: none; }

.cc-embed__placeholder > i { font-size: 30px; color: #1577bb; }
.cc-embed__placeholder p { margin: 6px 0 10px; max-width: 360px; font-size: 14px; line-height: 1.5; }
.cc-embed__placeholder strong { display: block; color: #0f1d2e; }

.cc-embed__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    font-size: 14px;
    font-weight: 600;
}

.cc-embed__actions a { color: #1577bb; }

/* footer "Cookie settings" is a button styled like the neighbouring links */
.ft-legal button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .25);
    text-underline-offset: 3px;
    cursor: pointer;
}

.ft-legal button:hover { color: #fff; text-decoration-color: currentColor; }

/* ---------- Small screens ---------- */

@media (max-width: 575.98px) {
    .cc-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        padding: 18px;
    }

    .cc-banner__actions .cc-btn { flex: 1 1 calc(50% - 5px); }
    .cc-banner__actions .cc-btn--link { flex-basis: 100%; }

    /* the full-width banner would cover the WhatsApp button */
    html.cc-banner-open .wa-float { display: none; }

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

@media (prefers-reduced-motion: reduce) {
    .cc-banner { animation: none; }
    .cc-switch__track,
    .cc-switch__track::after { transition: none; }
}
