/**
 * POUPADIM - Banner de consentimento LGPD.
 * Mobile-first, sem dependencia de tokens externos para evitar conflito
 * entre landing e dashboard (Tailwind no /sis/).
 */

.pd-consent[hidden] { display: none !important; }

.pd-consent {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pd-consent__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    pointer-events: auto;
    opacity: 0;
    animation: pdConsentFade 240ms ease-out forwards;
}

.pd-consent__panel {
    position: relative;
    pointer-events: auto;
    width: 100%;
    max-width: 720px;
    margin: 16px;
    padding: 20px 20px 16px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25), 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(16px);
    opacity: 0;
    animation: pdConsentRise 280ms cubic-bezier(0.22, 1, 0.36, 1) 80ms forwards;
}

.pd-consent__header h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pd-consent__header p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #475569;
}

.pd-consent__header a {
    color: #0080b8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pd-consent__details {
    margin: 14px 0 4px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.pd-consent__details > summary {
    cursor: pointer;
    font-size: 0.825rem;
    font-weight: 600;
    color: #0080b8;
    list-style: none;
    user-select: none;
}

.pd-consent__details > summary::-webkit-details-marker { display: none; }

.pd-consent__details > summary::after {
    content: ' \25BE';
    margin-left: 4px;
}

.pd-consent__details[open] > summary::after { content: ' \25B4'; }

.pd-consent__option {
    margin: 10px 0;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.pd-consent__option label {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 2px;
    align-items: start;
    font-size: 0.875rem;
    cursor: pointer;
}

.pd-consent__option input[type="checkbox"] {
    grid-row: 1 / span 2;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: #0080b8;
    cursor: pointer;
}

.pd-consent__option strong {
    grid-column: 2;
    font-weight: 600;
    color: #0f172a;
}

.pd-consent__option span {
    grid-column: 2;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.45;
}

.pd-consent__option input[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.pd-consent__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.pd-consent__btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 16px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease;
    min-height: 44px;
}

.pd-consent__btn:focus-visible {
    outline: 3px solid rgba(0, 160, 227, 0.35);
    outline-offset: 2px;
}

.pd-consent__btn--primary {
    background: linear-gradient(135deg, #0080b8 0%, #00638f 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 128, 184, 0.35);
}

.pd-consent__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 128, 184, 0.45);
}

.pd-consent__btn--secondary {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.pd-consent__btn--secondary:hover {
    background: #f1f5f9;
}

.pd-consent__btn--ghost {
    background: transparent;
    color: #475569;
    border-color: transparent;
}

.pd-consent__btn--ghost:hover {
    color: #0f172a;
    background: #f1f5f9;
}

@media (min-width: 640px) {
    .pd-consent__panel {
        margin: 0 0 24px;
        padding: 24px 24px 20px;
    }
    .pd-consent__header h2 { font-size: 1.15rem; }
    .pd-consent__header p { font-size: 0.9375rem; }
    .pd-consent__actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    .pd-consent__btn { min-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
    .pd-consent__backdrop,
    .pd-consent__panel {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

@keyframes pdConsentFade {
    to { opacity: 1; }
}

@keyframes pdConsentRise {
    to { opacity: 1; transform: translateY(0); }
}
