/* ============================================================
   OE LGPD Banner & Modal — Oeste Esporte
   Sem dependências externas | Responsivo | Acessível
   ============================================================ */

:root {
    --oe-primary:       #1a7a3c;
    --oe-primary-dark:  #145e2e;
    --oe-btn-text:      #ffffff;
    --oe-bg:            #ffffff;
    --oe-text:          #333333;
    --oe-radius:        12px;
    --oe-shadow:        0 8px 40px rgba(0,0,0,.18);
    --oe-overlay:       rgba(0,0,0,.55);
    --oe-transition:    350ms cubic-bezier(.4,0,.2,1);
    --oe-border:        #e5e7eb;
    --oe-muted:         #6b7280;
    --oe-toggle-size:   48px;
}

/* ── Reset base ──────────────────────────────────────────── */
#oe-lgpd-banner *,
#oe-lgpd-modal *,
#oe-lgpd-float-btn,
#oe-lgpd-float-btn * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================================
   BANNER
   ============================================================ */

#oe-lgpd-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;

    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--oe-transition), transform var(--oe-transition);
}

#oe-lgpd-banner.oe-lgpd-pos-bottom { bottom: 16px; }
#oe-lgpd-banner.oe-lgpd-pos-top    { top: 16px; transform: translateY(-20px); }

#oe-lgpd-banner.oe-lgpd-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#oe-lgpd-banner.oe-lgpd-hiding {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#oe-lgpd-banner.oe-lgpd-pos-top.oe-lgpd-hiding {
    transform: translateY(-20px);
}

/* Card flutuante centralizado */
#oe-lgpd-banner .oe-lgpd-banner-inner {
    background: var(--oe-bg);
    box-shadow: var(--oe-shadow);
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    width: 100%;
    max-width: 900px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Corpo do banner */
.oe-lgpd-banner-body {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.oe-lgpd-banner-icon {
    color: var(--oe-primary);
    flex-shrink: 0;
    display: flex;
}

.oe-lgpd-banner-icon svg {
    width: 22px;
    height: 22px;
}

.oe-lgpd-banner-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--oe-text);
    margin-bottom: 1px;
    line-height: 1.3;
}

.oe-lgpd-banner-desc {
    font-size: .75rem;
    color: var(--oe-muted);
    line-height: 1.4;
    margin: 0;
}

.oe-lgpd-banner-desc a {
    color: var(--oe-primary);
    text-decoration: underline;
}

/* Ações */
.oe-lgpd-banner-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

/* ── Botões ──────────────────────────────────────────────── */
.oe-lgpd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
    font-family: inherit;
    line-height: 1.2;
}

.oe-lgpd-btn:focus-visible {
    outline: 3px solid var(--oe-primary);
    outline-offset: 2px;
}

/* Primário: aceitar todos */
.oe-lgpd-btn-primary {
    background-color: var(--oe-primary);
    color: #000000;
    border-color: var(--oe-primary);
}
.oe-lgpd-btn-primary:hover {
    background-color: var(--oe-primary-dark);
    border-color: var(--oe-primary-dark);
}

/* Outline: personalizar */
.oe-lgpd-btn-outline {
    background-color: transparent;
    color: var(--oe-primary);
    border-color: var(--oe-primary);
}
.oe-lgpd-btn-outline:hover {
    background-color: var(--oe-primary);
    color: var(--oe-btn-text);
}

/* Ghost: apenas essenciais */
.oe-lgpd-btn-ghost {
    background-color: transparent;
    color: var(--oe-muted);
    border: 1.5px solid var(--oe-border) !important;
    outline: none !important;
}
.oe-lgpd-btn-ghost:hover {
    background-color: #f3f4f6;
    color: var(--oe-text);
    border-color: #d1d5db !important;
}

/* ============================================================
   MODAL
   ============================================================ */

#oe-lgpd-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;

    opacity: 0;
    transition: opacity var(--oe-transition);
}

#oe-lgpd-modal[hidden] { display: none !important; }

#oe-lgpd-modal.oe-lgpd-visible { opacity: 1; }

/* Overlay */
.oe-lgpd-overlay {
    position: absolute;
    inset: 0;
    background: var(--oe-overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Caixa do modal */
.oe-lgpd-modal-box {
    position: relative;
    background: #fff;
    border-radius: var(--oe-radius);
    box-shadow: var(--oe-shadow);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    transform: scale(.94) translateY(20px);
    transition: transform var(--oe-transition);
}

#oe-lgpd-modal.oe-lgpd-visible .oe-lgpd-modal-box {
    transform: scale(1) translateY(0);
}

/* Header */
.oe-lgpd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--oe-border);
    flex-shrink: 0;
}

.oe-lgpd-modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--oe-text);
}

.oe-lgpd-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--oe-muted);
    padding: 6px;
    border-radius: 6px;
    display: flex;
    transition: color .2s, background .2s;
}
.oe-lgpd-modal-close:hover { color: var(--oe-text); background: #f3f4f6; }
.oe-lgpd-modal-close:focus-visible { outline: 2px solid var(--oe-primary); }

/* Body */
.oe-lgpd-modal-body {
    overflow-y: auto;
    padding: 16px 24px;
    flex: 1;
}

.oe-lgpd-modal-intro {
    font-size: .875rem;
    color: var(--oe-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Categorias */
.oe-lgpd-category {
    border: 1px solid var(--oe-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.oe-lgpd-category:last-child { margin-bottom: 0; }

.oe-lgpd-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: #fafafa;
}

.oe-lgpd-category-info { flex: 1; min-width: 0; }

.oe-lgpd-category-info strong {
    display: block;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--oe-text);
    margin-bottom: 4px;
}

.oe-lgpd-category-info p {
    font-size: .8125rem;
    color: var(--oe-muted);
    line-height: 1.5;
}

.oe-lgpd-providers {
    display: inline-block;
    margin-top: 6px;
    font-size: .75rem;
    background: #eef2ff;
    color: #4338ca;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Badge "Sempre ativo" */
.oe-lgpd-badge-active {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--oe-primary);
    background: rgba(26,122,60,.1);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Toggle switch ───────────────────────────────────────── */
.oe-lgpd-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.oe-lgpd-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.oe-lgpd-toggle-track {
    display: block;
    width: var(--oe-toggle-size);
    height: 26px;
    border-radius: 13px;
    background: #d1d5db;
    transition: background .25s;
    position: relative;
}

.oe-lgpd-toggle input:checked + .oe-lgpd-toggle-track {
    background: var(--oe-primary);
}

.oe-lgpd-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transition: transform .25s;
}

.oe-lgpd-toggle input:checked + .oe-lgpd-toggle-track .oe-lgpd-toggle-thumb {
    transform: translateX(22px);
}

.oe-lgpd-toggle:focus-within .oe-lgpd-toggle-track {
    outline: 3px solid var(--oe-primary);
    outline-offset: 2px;
}

/* Footer do modal */
.oe-lgpd-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--oe-border);
    flex-shrink: 0;
    background: #fff;
}

.oe-lgpd-modal-footer .oe-lgpd-btn {
    flex: 1;
}

/* ============================================================
   BOTÃO FLUTUANTE
   ============================================================ */

#oe-lgpd-float-btn {
    display: none !important;
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999998;
    align-items: center;
    gap: 8px;
    background: var(--oe-primary);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 10px 16px 10px 12px;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    transition: transform .2s, opacity .3s, box-shadow .2s;

    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

#oe-lgpd-float-btn.oe-lgpd-visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

#oe-lgpd-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
}

#oe-lgpd-float-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

#oe-lgpd-float-btn svg { flex-shrink: 0; }

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 768px) {
    .oe-lgpd-banner-inner {
        flex-wrap: wrap;
        padding: 16px;
        gap: 10px;
    }

    .oe-lgpd-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .oe-lgpd-banner-body { flex: 1 1 100%; }
    .oe-lgpd-btn-primary { order: -1; }

    .oe-lgpd-modal-footer {
        flex-direction: column;
    }

    #oe-lgpd-float-btn {
        bottom: 16px;
        left: 16px;
    }
}

@media (max-width: 480px) {
    .oe-lgpd-banner-body { flex-direction: column; gap: 10px; }
    .oe-lgpd-banner-icon { margin-top: 0; }
    .oe-lgpd-modal-box { border-radius: 16px 16px 0 0; max-height: 95vh; }
    #oe-lgpd-modal { align-items: flex-end; padding: 0; }
}

/* ============================================================
   ACESSIBILIDADE — reduzir movimento
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    #oe-lgpd-banner,
    .oe-lgpd-modal-box,
    #oe-lgpd-modal,
    #oe-lgpd-float-btn,
    .oe-lgpd-toggle-track,
    .oe-lgpd-toggle-thumb { transition: none !important; }
}
