/**
 * Cordilheira LGPD — Frontend (visual moderno v2)
 * Identidade: preto-azul + amarelo Cordilheira (#f5be43)
 */

/* ── Reset local ─────────────────────────────────────────────────── */
.clgpd-banner *,
.clgpd-modal *,
.clgpd-floating-widget * {
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  BANNER PRINCIPAL                                                */
/* ═══════════════════════════════════════════════════════════════ */

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

@keyframes clgpd-slide-down {
    from { transform: translateY(-40px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.clgpd-banner {
    position: fixed;
    z-index: 999998;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 760px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 24px 70px rgba(2, 4, 21, 0.28),
        0 4px 14px rgba(2, 4, 21, 0.12);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    border: 1px solid rgba(2, 4, 21, 0.06);
}

.clgpd-banner-bottom {
    bottom: 24px;
    animation: clgpd-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.clgpd-banner-top {
    top: 24px;
    animation: clgpd-slide-down 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Faixa decorativa no topo (gradiente Cordilheira) */
.clgpd-banner::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(to right, #425e94, #f5be43, #425e94);
}

.clgpd-banner-container {
    padding: 22px 26px;
}

.clgpd-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
}

.clgpd-banner-text {
    flex: 1;
    min-width: 260px;
}

.clgpd-banner-text p {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #1d2327;
}

.clgpd-banner-text .clgpd-privacy-link {
    color: #425e94;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px dashed #425e94;
    padding-bottom: 1px;
    transition: color 0.15s ease;
}

.clgpd-banner-text .clgpd-privacy-link:hover {
    color: #020415;
    border-bottom-color: #020415;
}

/* ── Botões do banner ──────────────────────────────────────── */

.clgpd-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.clgpd-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.18s ease;
    line-height: 1.3;
    white-space: nowrap;
    font-family: 'Inter', -apple-system, sans-serif;
}

.clgpd-btn-accept-all {
    background: linear-gradient(135deg, #f5be43, #ffd76b);
    color: #020415;
    box-shadow: 0 4px 12px rgba(245, 190, 67, 0.35);
}

.clgpd-btn-accept-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 190, 67, 0.5);
}

.clgpd-btn-reject-all {
    background: transparent;
    color: #46464c;
    border: 1.5px solid #c7c5cd;
}

.clgpd-btn-reject-all:hover {
    background: #f2f3f6;
    border-color: #46464c;
    color: #020415;
}

.clgpd-btn-customize {
    background: transparent;
    color: #425e94;
    border: 1.5px solid #425e94;
}

.clgpd-btn-customize:hover {
    background: #425e94;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  MODAL DE PERSONALIZAÇÃO                                         */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes clgpd-modal-pop {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.clgpd-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.clgpd-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 21, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: clgpd-fade-in 0.2s ease-out;
}

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

.clgpd-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    max-width: 560px;
    width: 100%;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: clgpd-modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', -apple-system, sans-serif;
}

.clgpd-modal-header {
    background: linear-gradient(135deg, #020415, #1a1d30);
    color: #fff;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.clgpd-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #425e94, #f5be43, #425e94);
}

.clgpd-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Só o X do header — específico pra não vazar no Cancelar do footer */
.clgpd-modal-header .clgpd-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    padding: 0;
}

.clgpd-modal-header .clgpd-modal-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.clgpd-modal-body {
    padding: 22px 26px;
    overflow-y: auto;
    flex: 1;
}

.clgpd-category-item {
    background: #f9fafc;
    border: 1px solid #ededf2;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color 0.15s ease;
}

.clgpd-category-item:hover {
    border-color: #d9d9e0;
}

.clgpd-category-item:last-child { margin-bottom: 0; }

.clgpd-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.clgpd-category-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #020415;
}

.clgpd-category-description {
    margin: 0;
    color: #5a5b66;
    font-size: 13px;
    line-height: 1.5;
}

.clgpd-required-badge {
    display: inline-block;
    margin-top: 8px;
    background: #f6e7c5;
    color: #80551a;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Switch toggle */
.clgpd-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.clgpd-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.clgpd-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #c7c5cd;
    transition: background 0.2s ease;
    border-radius: 24px;
}

.clgpd-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    transition: transform 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.clgpd-switch input:checked + .clgpd-slider {
    background: linear-gradient(135deg, #f5be43, #ffd76b);
}

.clgpd-switch input:checked + .clgpd-slider::before {
    transform: translateX(20px);
}

.clgpd-switch input:disabled + .clgpd-slider {
    opacity: 0.65;
    cursor: not-allowed;
}

.clgpd-modal-footer {
    padding: 16px 26px;
    background: #f9fafc;
    border-top: 1px solid #ededf2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.clgpd-modal-footer .clgpd-btn-secondary {
    background: #fff;
    color: #46464c;
    border: 1.5px solid #c7c5cd;
}

.clgpd-modal-footer .clgpd-btn-secondary:hover {
    background: #f2f3f6;
    border-color: #46464c;
    color: #020415;
}

.clgpd-modal-footer .clgpd-btn-primary {
    background: linear-gradient(135deg, #f5be43, #ffd76b);
    color: #020415;
    box-shadow: 0 4px 12px rgba(245, 190, 67, 0.35);
}

.clgpd-modal-footer .clgpd-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 190, 67, 0.5);
}

/* ═══════════════════════════════════════════════════════════════ */
/*  WIDGET FLUTUANTE (após consentir)                              */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes clgpd-widget-in {
    from { transform: scale(0.5) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

@keyframes clgpd-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(245, 190, 67, 0.4), 0 0 0 0 rgba(245, 190, 67, 0.5); }
    50%      { box-shadow: 0 6px 20px rgba(245, 190, 67, 0.4), 0 0 0 12px rgba(245, 190, 67, 0); }
}

.clgpd-floating-widget {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 999997;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.clgpd-floating-widget.clgpd-widget-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    animation: clgpd-widget-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.clgpd-widget-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: linear-gradient(135deg, #020415, #1a1d30);
    color: #f5be43;
    border: 0;
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(2, 4, 21, 0.35);
    transition: all 0.25s ease, width 0.3s ease;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 700;
    font-size: 13px;
    width: 52px;
    height: 52px;
    min-width: 52px;
    position: relative;
}

.clgpd-widget-toggle:hover { width: auto; }

.clgpd-widget-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1.5px solid rgba(245, 190, 67, 0.25);
    pointer-events: none;
}

.clgpd-widget-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(2, 4, 21, 0.45);
}

.clgpd-widget-toggle svg {
    width: 24px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
    transition: transform 0.3s ease, margin 0.3s ease;
}

.clgpd-widget-toggle:hover svg {
    margin-left: 18px;
    transform: rotate(-15deg);
}

.clgpd-widget-text {
    padding: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}

.clgpd-widget-toggle:hover .clgpd-widget-text {
    max-width: 220px;
    opacity: 1;
    padding-right: 20px;
    padding-left: 2px;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  RESPONSIVO                                                      */
/* ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .clgpd-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        transform: none;
        max-width: none;
    }
    .clgpd-banner-top {
        top: 12px;
        bottom: auto;
    }
    .clgpd-banner-container {
        padding: 18px 20px;
    }
    .clgpd-banner-content {
        gap: 16px;
    }
    .clgpd-banner-actions {
        width: 100%;
    }
    .clgpd-banner-actions .clgpd-btn {
        flex: 1;
        text-align: center;
    }

    .clgpd-modal-content {
        max-height: 92vh;
        border-radius: 14px;
    }
    .clgpd-modal-header {
        padding: 18px 20px;
    }
    .clgpd-modal-body {
        padding: 18px 20px;
    }
    .clgpd-modal-footer {
        padding: 14px 20px;
    }

    .clgpd-floating-widget {
        left: 14px;
        bottom: 14px;
    }
    .clgpd-widget-toggle {
        height: 48px;
        min-width: 48px;
    }
    .clgpd-widget-toggle svg {
        width: 20px;
        height: 20px;
        margin: 0 14px;
    }
}
