/* ==========================================================================
   SIVONALDO JÚNIOR ADVOGADOS — PÁGINA DE TERMOS DE USO
   Arquivo: src/styles/termos.css
   Depende de: src/styles/style.css (variáveis, header, footer, botões)
   Reutilizável também para a Política de Privacidade (mesmas classes .legal-*)
   ========================================================================== */

html {
    scroll-padding-top: 110px; /* compensa o header fixo ao navegar pelo índice */
}

/* --------------------------------------------------------------------------
   1. HERO (AZUL)
   -------------------------------------------------------------------------- */
.legal-hero {
    background: var(--hero-radial-gradient) !important;
    padding: calc(var(--header-height) + 4.5rem) 0 4.5rem;
    position: relative;
    overflow: hidden;
}

.legal-hero .section-watermark {
    opacity: 0.12;
    right: 3%;
    width: 520px;
    height: 520px;
    filter: drop-shadow(0 0 50px rgba(199, 165, 117, 0.25));
}

.legal-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.legal-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(238, 240, 242, 0.7);
    margin-bottom: 1.5rem;
}

.legal-breadcrumb a {
    color: var(--gold-brand);
    font-weight: 500;
}

.legal-breadcrumb a:hover {
    color: var(--gold-light);
}

.legal-breadcrumb i,
.legal-breadcrumb svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.legal-hero-title {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--warm-white);
    margin-bottom: 1.25rem;
}

.legal-hero-desc {
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    color: rgba(238, 240, 242, 0.85);
    line-height: 1.7;
    max-width: 640px;
    margin: 0 auto 2rem;
}

.legal-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
}

.legal-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(238, 240, 242, 0.85);
    background: rgba(30, 39, 53, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    padding: 0.45rem 1rem;
    backdrop-filter: blur(10px);
}

.legal-hero-meta i,
.legal-hero-meta svg {
    width: 15px;
    height: 15px;
    color: var(--gold-brand);
}

/* --------------------------------------------------------------------------
   2. SEÇÃO DE CONTEÚDO (CLARA)
   O overflow precisa ser "visible" para o índice lateral (sticky) funcionar.
   -------------------------------------------------------------------------- */
.legal-section {
    background-color: var(--bg-respiro) !important;
    color: var(--navy-deep-3);
    padding: 5rem 0 6.5rem;
    overflow: visible;
}

.legal-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

/* --------------------------------------------------------------------------
   3. ÍNDICE LATERAL
   -------------------------------------------------------------------------- */
.legal-toc {
    position: sticky;
    top: 110px;
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    box-shadow: 0 10px 30px rgba(20, 26, 36, 0.06);
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.legal-toc-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-light);
}

.legal-toc-title i,
.legal-toc-title svg {
    width: 16px;
    height: 16px;
}

.legal-toc-list {
    list-style: none;
    counter-reset: toc;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.legal-toc-list li {
    counter-increment: toc;
}

.legal-toc-list a {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--navy-brand);
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: all var(--transition-fast);
}

.legal-toc-list a::before {
    content: counter(toc, decimal-leading-zero);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold-dark);
    flex-shrink: 0;
}

.legal-toc-list a:hover {
    background: rgba(199, 165, 117, 0.1);
    color: var(--navy-deep-3);
}

.legal-toc-list a.active {
    background: rgba(199, 165, 117, 0.16);
    border-left-color: var(--gold-brand);
    color: var(--navy-deep-3);
    font-weight: 600;
}

.legal-toc-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding: 0.8rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--warm-white);
    background: var(--navy-deep-3);
    border-radius: var(--radius-pill);
    transition: all var(--transition-normal);
}

.legal-toc-cta i {
    color: var(--gold-brand);
    font-size: 1.05rem;
}

.legal-toc-cta:hover {
    background: var(--navy-brand);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(20, 26, 36, 0.2);
}

/* --------------------------------------------------------------------------
   4. CARTÃO DO DOCUMENTO
   -------------------------------------------------------------------------- */
.legal-card {
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 3rem 3.25rem;
    box-shadow: 0 15px 40px rgba(20, 26, 36, 0.07);
    counter-reset: legal;
    position: relative;
}

.legal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3.25rem;
    right: 3.25rem;
    height: 3px;
    background: var(--gold-gradient);
    border-radius: 0 0 4px 4px;
}

/* Cada bloco é uma <section>, então neutralizamos o estilo global de "section" */
.legal-card section.legal-block {
    padding: 0;
    overflow: visible;
    position: relative;
    margin-bottom: 2.75rem;
    padding-bottom: 2.75rem;
    border-bottom: 1px solid var(--border-light);
}

.legal-card section.legal-block:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
    padding-bottom: 0;
}

.legal-block h2 {
    counter-increment: legal;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 700;
    color: var(--navy-deep-3);
    letter-spacing: -0.01em;
    margin-bottom: 1.15rem;
}

.legal-block h2::before {
    content: counter(legal, decimal-leading-zero);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold-dark);
    background: rgba(199, 165, 117, 0.14);
    border: 1px solid rgba(199, 165, 117, 0.4);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.legal-block p {
    font-size: 0.97rem;
    line-height: 1.85;
    color: var(--navy-brand);
    margin-bottom: 1rem;
}

.legal-block p:last-child {
    margin-bottom: 0;
}

.legal-block strong {
    color: var(--navy-deep-3);
    font-weight: 600;
}

.legal-block a:not(.legal-contact-item):not(.loc-cta-btn):not(.legal-back-btn) {
    color: var(--gold-dark);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(138, 110, 69, 0.35);
    text-underline-offset: 3px;
    transition: all var(--transition-fast);
}

.legal-block a:not(.legal-contact-item):not(.loc-cta-btn):not(.legal-back-btn):hover {
    color: var(--navy-deep-3);
    text-decoration-color: var(--gold-brand);
}

.legal-block ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0.35rem 0 1.15rem;
}

.legal-block ul li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--navy-brand);
}

.legal-block ul li::before {
    content: '';
    position: absolute;
    left: 0.15rem;
    top: 0.72em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold-gradient);
}

/* --------------------------------------------------------------------------
   5. NOTAS E DESTAQUES
   -------------------------------------------------------------------------- */
.legal-note {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--navy-deep-3);
    border: 1px solid rgba(199, 165, 117, 0.28);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    margin: 0.75rem 0 3rem;
}

.legal-note i,
.legal-note svg {
    width: 22px;
    height: 22px;
    color: var(--gold-brand);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.legal-note p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(238, 240, 242, 0.9);
}

.legal-callout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(199, 165, 117, 0.1);
    border: 1px solid rgba(199, 165, 117, 0.35);
    border-left: 4px solid var(--gold-brand);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    margin-top: 1.4rem;
}

.legal-callout i,
.legal-callout svg {
    width: 22px;
    height: 22px;
    color: var(--gold-dark);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.legal-block .legal-callout p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.7;
}

.legal-callout.warning {
    background: rgba(48, 62, 83, 0.07);
    border-color: rgba(48, 62, 83, 0.22);
    border-left-color: var(--navy-brand);
}

.legal-callout.warning i,
.legal-callout.warning svg {
    color: var(--navy-brand);
}

/* --------------------------------------------------------------------------
   6. LISTA DE DEFINIÇÕES (IDENTIFICAÇÃO)
   -------------------------------------------------------------------------- */
.legal-dl {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.legal-dl > div {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 1rem;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.legal-dl > div:last-child {
    border-bottom: none;
}

.legal-dl > div:nth-child(odd) {
    background: rgba(238, 240, 242, 0.55);
}

.legal-dl dt {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

.legal-dl dd {
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--navy-deep-3);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   7. CARTÕES DE CONTATO
   -------------------------------------------------------------------------- */
.legal-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.legal-contact-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.15rem;
    background: var(--bg-respiro);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    min-width: 0;
}

.legal-contact-item:hover {
    border-color: var(--gold-brand);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(20, 26, 36, 0.1);
}

.legal-contact-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--navy-deep-3);
    color: var(--gold-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}

.legal-contact-icon i,
.legal-contact-icon svg {
    width: 20px;
    height: 20px;
}

.legal-contact-item > span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.legal-contact-item strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy-deep-3);
}

.legal-contact-item small {
    font-size: 0.78rem;
    color: var(--navy-brand);
    overflow-wrap: anywhere;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   8. AÇÕES FINAIS
   -------------------------------------------------------------------------- */
.legal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.legal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy-deep-3);
    background: transparent;
    border: 1px solid rgba(48, 62, 83, 0.25);
    border-radius: var(--radius-pill);
    transition: all var(--transition-normal);
}

.legal-back-btn i,
.legal-back-btn svg {
    width: 17px;
    height: 17px;
    color: var(--gold-dark);
    transition: transform var(--transition-fast);
}

.legal-back-btn:hover {
    border-color: var(--gold-brand);
    background: rgba(199, 165, 117, 0.1);
    transform: translateY(-2px);
}

.legal-back-btn:hover i {
    transform: translateX(-4px);
}

/* --------------------------------------------------------------------------
   9. RESPONSIVO
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .legal-layout {
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 1.75rem;
    }

    .legal-card {
        padding: 2.5rem 2.25rem;
    }

    .legal-card::before {
        left: 2.25rem;
        right: 2.25rem;
    }

    .legal-contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .legal-hero {
        padding: calc(var(--header-height) + 3rem) 0 3.5rem;
    }

    .legal-section {
        padding: 3rem 0 4.5rem;
    }

    .legal-layout {
        grid-template-columns: 1fr;
    }

    /* Índice vira bloco no topo, sem sticky */
    .legal-toc {
        position: static;
        max-height: none;
    }

    .legal-toc-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.15rem 0.75rem;
    }
}

@media (max-width: 767px) {
    .legal-hero {
        padding: calc(var(--header-height) + 2.5rem) 0 3rem;
    }

    .legal-toc-list {
        grid-template-columns: 1fr;
    }

    .legal-card {
        padding: 2rem 1.35rem;
        border-radius: var(--radius-md);
    }

    .legal-card::before {
        left: 1.35rem;
        right: 1.35rem;
    }

    .legal-block h2 {
        gap: 0.7rem;
        align-items: flex-start;
    }

    .legal-block h2::before {
        min-width: 36px;
        height: 36px;
        font-size: 0.78rem;
    }

    .legal-block p,
    .legal-block ul li {
        font-size: 0.92rem;
    }

    .legal-dl > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .legal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .legal-actions .loc-cta-btn,
    .legal-actions .legal-back-btn {
        width: 100%;
        justify-content: center;
    }

    .legal-note,
    .legal-callout {
        padding: 1.1rem 1.1rem;
    }
}

/* --------------------------------------------------------------------------
   10. IMPRESSÃO
   -------------------------------------------------------------------------- */
@media print {
    .site-header,
    .mobile-drawer,
    .mobile-drawer-overlay,
    .legal-toc,
    .legal-actions,
    .floating-whatsapp-btn,
    .site-footer,
    .legal-hero .section-watermark {
        display: none !important;
    }

    body,
    .legal-hero,
    .legal-section {
        background: #fff !important;
        color: #000 !important;
    }

    .legal-hero {
        padding: 1rem 0;
    }

    .legal-hero-title,
    .legal-hero-desc,
    .legal-hero-meta span {
        color: #000 !important;
        background: none !important;
        border: none !important;
    }

    .legal-layout {
        display: block;
    }

    .legal-card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}