/* Aviso e preferências de cookies. Independente do Bootstrap: funciona também nas páginas legais. */
.ck-banner,
.ck-dialog,
.embed-gate {
    --ck-bg: #0b1f36;
    --ck-bg-2: #14304f;
    --ck-text: #f1f5f9;
    --ck-muted: #b6c3d3;
    --ck-line: rgba(255, 255, 255, 0.16);
    --ck-accent: #f97316;
    --ck-accent-dark: #e55c0d;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Aviso ---------- */
.ck-banner {
    background: var(--ck-bg);
    border: 1px solid var(--ck-line);
    border-radius: 14px;
    bottom: 1.25rem;
    box-shadow: 0 24px 60px rgba(4, 12, 24, 0.45);
    color: var(--ck-text);
    left: 1.25rem;
    max-width: 440px;
    padding: 1.5rem;
    position: fixed;
    width: calc(100% - 2.5rem);
    z-index: 2000;
}

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

.ck-banner h2 {
    color: var(--ck-text);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.6rem;
}

.ck-banner p {
    color: var(--ck-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 1.1rem;
}

.ck-banner p a,
.ck-dialog a {
    color: #fdba74;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ck-actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr 1fr;
}

.ck-btn {
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    transition: background-color 0.15s, border-color 0.15s;
}

/* Rejeitar e Aceitar têm o mesmo peso visual: recusar não pode ser mais difícil que aceitar */
.ck-btn-reject {
    background: var(--ck-text);
    color: var(--ck-bg);
}

.ck-btn-reject:hover {
    background: #fff;
}

.ck-btn-accept {
    background: var(--ck-accent);
    color: #1a0c00;
}

.ck-btn-accept:hover {
    background: #fb8a3c;
}

.ck-btn-custom {
    background: transparent;
    border-color: var(--ck-line);
    color: var(--ck-text);
    grid-column: 1 / -1;
}

.ck-btn-custom:hover {
    border-color: var(--ck-muted);
}

.ck-banner :focus-visible,
.ck-dialog :focus-visible,
.embed-gate :focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* ---------- Preferências ---------- */
.ck-dialog {
    background: var(--ck-bg);
    border: 1px solid var(--ck-line);
    border-radius: 16px;
    color: var(--ck-text);
    max-height: calc(100dvh - 2rem);
    max-width: 560px;
    overflow: auto;
    padding: 0;
    width: calc(100% - 2rem);
}

.ck-dialog::backdrop {
    background: rgba(4, 12, 24, 0.7);
}

.ck-dialog-inner {
    padding: 1.75rem;
}

.ck-dialog h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 0.5rem;
}

.ck-dialog .ck-lead {
    color: var(--ck-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

.ck-cat {
    border-top: 1px solid var(--ck-line);
    padding: 1.1rem 0;
}

.ck-cat-head {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.ck-cat h3 {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0;
}

.ck-cat p {
    color: var(--ck-muted);
    font-size: 0.86rem;
    line-height: 1.55;
    margin: 0.45rem 0 0;
}

.ck-always {
    color: var(--ck-muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Interruptor: input real, por isso funciona com teclado e leitor de tela */
.ck-switch {
    flex: none;
    height: 28px;
    position: relative;
    width: 50px;
}

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

.ck-switch span {
    background: var(--ck-bg-2);
    border: 1px solid var(--ck-muted);
    border-radius: 999px;
    inset: 0;
    position: absolute;
    transition: background-color 0.15s;
}

.ck-switch span::after {
    background: var(--ck-text);
    border-radius: 50%;
    content: '';
    height: 20px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.15s;
    width: 20px;
}

.ck-switch input:checked + span {
    background: var(--ck-accent);
    border-color: var(--ck-accent);
}

.ck-switch input:checked + span::after {
    background: #1a0c00;
    transform: translateX(22px);
}

.ck-switch input:focus-visible + span {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

.ck-dialog-actions {
    border-top: 1px solid var(--ck-line);
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr 1fr;
    padding-top: 1.25rem;
}

.ck-dialog-actions .ck-btn-custom {
    grid-column: auto;
}

/* ---------- Conteúdo bloqueado até haver permissão (mapa) ---------- */
.embed-gate {
    align-items: center;
    background: var(--ck-bg);
    border-radius: 16px;
    color: var(--ck-text);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
    min-height: 260px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.embed-gate p {
    color: var(--ck-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
    max-width: 46ch;
}

.embed-gate a {
    color: #fdba74;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.embed-gate .ck-btn {
    min-width: 220px;
}

@media (max-width: 520px) {
    .ck-banner {
        border-radius: 14px 14px 0 0;
        bottom: 0;
        left: 0;
        max-width: none;
        padding: 1.25rem;
        width: 100%;
    }

    .ck-actions,
    .ck-dialog-actions {
        grid-template-columns: 1fr;
    }

    .ck-dialog-inner {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ck-btn,
    .ck-switch span,
    .ck-switch span::after {
        transition: none;
    }
}
