/* ── Cookie Consent — banner e preferências ──────────────────────────────────
   Estilos opt-in para o sistema de consentimento de cookies.
   Não afeta outras páginas. Complementa o Tailwind.
──────────────────────────────────────────────────────────────────────────── */

/* ── Banner card ─────────────────────────────────────────────────────────── */

.cookie-banner-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    padding: 1.125rem 1.375rem 1.25rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.18),
        0 10px 20px -8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(99, 102, 241, 0.04);
}

.cookie-icon-wrap {
    font-size: 1rem;
    line-height: 1;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 0.5rem;
}

/* ── Ações do banner ─────────────────────────────────────────────────────── */

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

@media (max-width: 560px) {
    .cookie-actions {
        flex-direction: column-reverse;
        justify-content: stretch;
    }
    .cookie-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Botão primário: Aceitar todos */
.cookie-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.125rem;
    border-radius: 0.625rem;
    background: #4f46e5;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease;
    white-space: nowrap;
    line-height: 1.4;
}
.cookie-btn-primary:hover { background: #4338ca; }
.cookie-btn-primary:active { background: #3730a3; }
.cookie-btn-primary:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

/* Botão secundário: Configurar */
.cookie-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.125rem;
    border-radius: 0.625rem;
    background: transparent;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
    white-space: nowrap;
    line-height: 1.4;
}
.cookie-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}
.cookie-btn-outline:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Botão ghost: Apenas necessários */
.cookie-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    background: transparent;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
    white-space: nowrap;
    line-height: 1.4;
}
.cookie-btn-ghost:hover {
    color: #475569;
    background: #f1f5f9;
}
.cookie-btn-ghost:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ── Categorias de preferências ──────────────────────────────────────────── */

.cookie-category-card {
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 0.875rem;
    padding: 1rem;
}

.cookie-category-card + .cookie-category-card {
    margin-top: 0;
}

.cookie-cat-icon {
    font-size: 0.9375rem;
    line-height: 1;
    flex-shrink: 0;
}

.cookie-always-on {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    border-radius: 9999px;
    padding: 0.1875rem 0.625rem;
    white-space: nowrap;
    border: 1px solid #a7f3d0;
}

/* ── Toggle switch (CSS puro) ────────────────────────────────────────────── */

.cookie-toggle {
    position: relative;
    display: inline-block;
    cursor: pointer;
    flex-shrink: 0;
}

.cookie-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.cookie-toggle-track {
    display: block;
    width: 2.625rem;
    height: 1.5rem;
    background: #cbd5e1;
    border-radius: 9999px;
    transition: background 200ms ease;
    position: relative;
}

.cookie-toggle-track::after {
    content: '';
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.125rem;
    height: 1.125rem;
    background: #ffffff;
    border-radius: 9999px;
    transition: transform 200ms ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12);
}

.cookie-toggle input[type="checkbox"]:checked + .cookie-toggle-track {
    background: #4f46e5;
}

.cookie-toggle input[type="checkbox"]:checked + .cookie-toggle-track::after {
    transform: translateX(1.125rem);
}

.cookie-toggle input[type="checkbox"]:focus-visible + .cookie-toggle-track {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

/* ── Botão "Gerenciar cookies" no footer ─────────────────────────────────── */

.cookie-manage-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 0.875rem;
    padding: 0;
    transition: color 150ms ease;
    font-family: inherit;
}
.cookie-manage-btn:hover { color: #cbd5e1; }
.cookie-manage-btn:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 2px;
}
