/* ============================================================
   COOKIE CONSENT — LGPD (Educative Cursos)
   Banner + modal de configuracoes. CSS proprio, sem dependencias.
   ============================================================ */

:root {
    --cc-navy: #1a2e5a;
    --cc-navy-2: #24407a;
    --cc-accept: #1f8a70;
    --cc-accept-hover: #17715b;
    --cc-reject: #4a5568;
    --cc-reject-hover: #364154;
    --cc-border: #e2e8f0;
    --cc-text: #2d3748;
    --cc-muted: #64748b;
}

/* Oculto ate o JS decidir (evita flash) */
.cc-hidden { display: none !important; }

/* ---------- BANNER ---------- */
.cc-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 99990;
    max-width: 960px;
    margin: 0 auto;
    background: var(--cc-navy);
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    animation: cc-slide-up .35s ease;
}

@keyframes cc-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.cc-banner__text {
    flex: 1 1 340px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.cc-banner__text strong { color: #fff; }

.cc-banner__text a {
    color: #ffd27a;
    text-decoration: underline;
    font-weight: 600;
}

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

/* ---------- BOTOES ---------- */
.cc-btn {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 11px 20px;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}

.cc-btn--accept { background: var(--cc-accept); color: #fff; }
.cc-btn--accept:hover { background: var(--cc-accept-hover); }

.cc-btn--reject { background: var(--cc-reject); color: #fff; }
.cc-btn--reject:hover { background: var(--cc-reject-hover); }

.cc-btn--settings {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}
.cc-btn--settings:hover { border-color: #fff; background: rgba(255,255,255,0.08); }

/* ---------- MODAL ---------- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    animation: cc-fade .25s ease;
}

@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }

.cc-modal__box {
    background: #fff;
    color: var(--cc-text);
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.cc-modal__head {
    position: relative;
    text-align: center;
    padding: 26px 26px 14px;
    border-bottom: 1px solid var(--cc-border);
}

.cc-modal__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--cc-navy);
    margin: 0 0 8px;
    letter-spacing: .5px;
}

.cc-modal__intro {
    font-size: 13.5px;
    color: var(--cc-muted);
    line-height: 1.6;
    margin: 0;
}

.cc-modal__close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--cc-muted);
    cursor: pointer;
}
.cc-modal__close:hover { color: var(--cc-navy); }

/* ---------- CARDS DE CATEGORIA ---------- */
.cc-cats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 22px 26px;
}

.cc-cat {
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
}

.cc-cat--on {
    border-color: var(--cc-navy);
    box-shadow: 0 0 0 2px rgba(26, 46, 90, 0.12);
    background: #f5f8ff;
}

.cc-cat__icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #eef2f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-navy);
}
.cc-cat__icon svg { width: 22px; height: 22px; }

.cc-cat__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--cc-navy);
    margin: 0 0 10px;
}

/* Toggle */
.cc-switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: .25s;
}
.cc-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
}
.cc-switch input:checked + .cc-slider { background: var(--cc-accept); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:disabled + .cc-slider { background: var(--cc-navy); cursor: not-allowed; opacity: .7; }

/* ---------- DETALHE (o que o site fara / nao fara) ---------- */
.cc-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 26px 8px;
    font-size: 13px;
    line-height: 1.55;
}
.cc-detail__col h4 { font-size: 14px; color: var(--cc-navy); margin: 0 0 10px; }
.cc-detail__col ul { list-style: none; padding: 0; margin: 0; }
.cc-detail__col li { padding: 6px 0; color: var(--cc-muted); border-bottom: 1px dashed #eef0f4; }
.cc-detail__col li strong { color: var(--cc-text); }

/* ---------- ACOES DO MODAL ---------- */
.cc-modal__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 26px 26px;
    border-top: 1px solid var(--cc-border);
}
.cc-modal__actions .cc-btn--accept,
.cc-modal__actions .cc-btn--reject,
.cc-modal__actions .cc-btn--save { color: #fff; }
.cc-btn--save { background: var(--cc-navy); }
.cc-btn--save:hover { background: var(--cc-navy-2); }

/* ---------- BOTAO FLUTUANTE PARA REABRIR ---------- */
.cc-reopen {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 99980;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--cc-navy);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-reopen:hover { background: var(--cc-navy-2); }
.cc-reopen svg { width: 22px; height: 22px; }

/* Link "Preferencias de Cookies" no rodape */
.cc-prefs-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}
.cc-prefs-link:hover { text-decoration: underline; }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 780px) {
    .cc-banner { flex-direction: column; align-items: stretch; text-align: center; padding: 20px; }
    .cc-banner__actions { justify-content: center; }
    .cc-btn { flex: 1 1 auto; }
    .cc-cats { grid-template-columns: repeat(2, 1fr); }
    .cc-detail { grid-template-columns: 1fr; gap: 8px; }
    .cc-reopen { bottom: 84px; }
}
