/* ============================================================
   CalculaCDI — Cookie Consent Banner (LGPD + Consent Mode v2)
   Arquivo: css/cookie-consent.css
   ============================================================ */

/* ---------- Overlay ---------- */
#cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

#cc-overlay.cc-visible {
    opacity: 1;
    pointer-events: all;
}

/* ---------- Banner principal (bottom bar) ---------- */
#cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-top: 1.5px solid #e2e8f0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.10);
    padding: 20px 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Sora', -apple-system, sans-serif;
}

#cc-banner.cc-visible {
    transform: translateY(0);
}

.cc-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.cc-text {
    flex: 1;
    min-width: 260px;
}

.cc-text h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.cc-text p {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.65;
    margin: 0;
}

.cc-text a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Botões ---------- */
.cc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    min-width: 200px;
}

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
    text-align: center;
}

.cc-btn:active {
    transform: scale(0.98);
}

.cc-btn-accept {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.cc-btn-accept:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.cc-btn-reject {
    background: #ffffff;
    color: #475569;
    border-color: #cbd5e1;
}

.cc-btn-reject:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.cc-btn-settings {
    background: transparent;
    color: #94a3b8;
    border-color: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 4px 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-btn-settings:hover {
    color: #64748b;
}

/* ---------- Modal de preferências ---------- */
#cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#cc-modal.cc-visible {
    opacity: 1;
    pointer-events: all;
}

.cc-modal-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    max-height: 90vh;
    overflow-y: auto;
}

.cc-modal-box h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.cc-modal-box>p {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px;
}

/* Itens de categoria */
.cc-category {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.cc-category-header h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.cc-category p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
}

/* Toggle switch */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: background 0.2s;
}

.cc-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    left: 3px;
    top: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-toggle input:checked+.cc-slider {
    background: #2563eb;
}

.cc-toggle input:checked+.cc-slider::before {
    transform: translateX(18px);
}

.cc-toggle input:disabled+.cc-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badge obrigatório */
.cc-required {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Ações do modal */
.cc-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.cc-modal-actions .cc-btn {
    flex: 1;
    min-width: 120px;
}

/* ---------- Botão flutuante para rever preferências ---------- */
#cc-reopen {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 9990;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-size: 18px;
    transition: box-shadow 0.15s, transform 0.15s;
}

#cc-reopen:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    transform: scale(1.05);
}

#cc-reopen.cc-show {
    display: flex;
}

/* ---------- Responsivo ---------- */
@media (max-width: 600px) {
    #cc-banner {
        padding: 16px;
    }

    .cc-inner {
        flex-direction: column;
        gap: 16px;
    }

    .cc-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cc-btn-accept,
    .cc-btn-reject {
        flex: 1;
        min-width: 120px;
    }

    .cc-btn-settings {
        width: 100%;
        text-align: center;
    }
}