/* ═══════════════════════════════════════════════
   AGT CODE — Legal Pages & FAQ Styles
   ═══════════════════════════════════════════════ */

/* ── Legal Page Layout ── */
.legal-page {
    padding: 120px 24px 80px;
    min-height: 100vh;
    background: var(--bg-alt);
}

.legal-container {
    max-width: 820px;
    margin: 0 auto;
}

/* ── Header ── */
.legal-header {
    text-align: center;
    margin-bottom: 48px;
}

.legal-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--primary-dim);
    color: var(--primary);
    margin-bottom: 16px;
}

.legal-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.legal-subtitle {
    font-size: 15px;
    color: var(--fg2);
}

/* ── Intro ── */
.legal-intro {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius, 16px);
    padding: 32px;
    margin-bottom: 40px;
    line-height: 1.75;
}

.legal-intro p {
    color: var(--fg2);
    font-size: 15px;
    margin-bottom: 12px;
}

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

/* ── Sections ── */
.legal-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.legal-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-dim);
}

.legal-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--fg);
    margin-top: 24px;
    margin-bottom: 10px;
}

.legal-section p {
    color: var(--fg2);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 12px;
}

.legal-section p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.legal-section p a:hover {
    text-decoration: underline;
}

/* ── Lists ── */
.legal-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 16px;
}

.legal-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    color: var(--fg2);
    font-size: 15px;
    line-height: 1.65;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.5;
}

/* ── Card (contact info, etc) ── */
.legal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    overflow: hidden;
    margin: 16px 0;
}

.legal-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.legal-card-row:last-child {
    border-bottom: none;
}

.legal-label {
    font-weight: 600;
    color: var(--fg);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.legal-card-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.legal-card-row a:hover {
    text-decoration: underline;
}

/* ── Table ── */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    border-radius: var(--radius-sm, 10px);
    overflow: hidden;
    border: 1px solid var(--border);
}

.legal-table thead {
    background: var(--primary-dim);
}

.legal-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--fg);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.legal-table td {
    padding: 12px 16px;
    color: var(--fg2);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.legal-table tbody tr:last-child td {
    border-bottom: none;
}

.legal-table tbody tr:hover {
    background: var(--bg-alt);
}

/* ── Highlight Box ── */
.legal-highlight {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--primary-dim);
    border: 1px solid var(--primary-dim);
    border-radius: var(--radius-sm, 10px);
    padding: 20px 24px;
    margin: 16px 0;
}

.legal-highlight-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.legal-highlight strong {
    display: block;
    color: var(--fg);
    font-size: 15px;
    margin-bottom: 6px;
}

.legal-highlight p {
    color: var(--fg2);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 0;
}

/* ── Rights Grid ── */
.legal-rights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.legal-right {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    padding: 20px;
    transition: border-color 0.2s ease;
}

.legal-right:hover {
    border-color: var(--border-hover);
}

.legal-right strong {
    display: block;
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 6px;
}

.legal-right p {
    color: var(--fg2);
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 0;
}

/* ── Definitions ── */
.legal-definitions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.legal-def {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    padding: 18px 22px;
}

.legal-def strong {
    display: block;
    color: var(--fg);
    font-size: 15px;
    margin-bottom: 6px;
}

.legal-def p {
    color: var(--fg2);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ── Purpose blocks ── */
.legal-purpose {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    padding: 22px 24px;
    margin-bottom: 16px;
}

.legal-purpose h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.legal-purpose p {
    margin-bottom: 10px;
}

.legal-basis {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    background: var(--itam-dim);
    color: var(--itam-color);
}

/* ═══════════════════════════════════════════════
   FAQ STYLES
   ═══════════════════════════════════════════════ */

.faq-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.faq-category-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 0 16px;
    margin: 0 0 20px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-category-title::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--border) 0%, transparent 70%);
}

.faq-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary-dim);
    color: var(--primary);
    flex-shrink: 0;
}

/* ── FAQ Page Header enlarged ── */
.faq-page .legal-header {
    margin-bottom: 32px;
}
.faq-page .legal-header h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 16px;
}
@media (max-width: 768px) {
    .faq-page .legal-header h1 { font-size: 2rem; }
}

/* ── Updated badge ── */
.faq-updated-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: var(--fg3);
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.faq-updated-badge svg { opacity: 0.7; flex-shrink: 0; }

/* ── Search ── */
.faq-search-wrap {
    position: relative;
    margin: 0 0 40px;
}
.faq-search {
    width: 100%;
    padding: 14px 48px 14px 46px;
    font-family: inherit;
    font-size: 15px;
    color: var(--fg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.faq-search::placeholder { color: var(--fg4); }
.faq-search::-webkit-search-cancel-button,
.faq-search::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.faq-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.faq-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg4);
    pointer-events: none;
}
.faq-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--fg3);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.faq-search-clear:hover {
    background: var(--primary-dim);
    color: var(--primary);
}

/* ── No results ── */
.faq-no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--fg3);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin: 24px 0 40px;
}
.faq-no-results svg { color: var(--fg4); margin-bottom: 10px; }
.faq-no-results p { font-size: 14px; margin: 0; color: var(--fg2); }

/* ── Smooth open animation for FAQ items ── */
.faq-item[open] .faq-answer {
    animation: faq-slide-in 0.25s ease-out;
}
@keyframes faq-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.faq-item[open] summary {
    color: var(--primary);
}

/* ── Accordion ── */
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.faq-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.faq-item[open] {
    border-color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.faq-item summary {
    padding: 18px 24px;
    padding-right: 64px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
    cursor: pointer;
    list-style: none;
    position: relative;
    line-height: 1.5;
    transition: background 0.15s ease;
}

.faq-item summary:hover {
    background: var(--bg-alt);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    color: var(--primary);
    background: var(--primary-dim);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.faq-item summary:hover::after {
    background: var(--primary);
    color: #ffffff;
}

.faq-item[open] summary::after {
    content: '+';
    transform: translateY(-50%) rotate(45deg);
    background: var(--primary);
    color: #ffffff;
}

.faq-answer {
    padding: 0 24px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--fg2);
}

.faq-answer p {
    margin-bottom: 10px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    padding-left: 20px;
    margin: 8px 0;
}

.faq-answer li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.faq-answer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* ── Help Box ── */
.faq-help-box {
    text-align: center;
    margin-top: 56px;
    padding: 48px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 24px);
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.06));
}

.faq-help-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 10px;
}

.faq-help-box p {
    color: var(--fg2);
    font-size: 15px;
    margin-bottom: 24px;
}

.faq-help-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.faq-help-actions .btn {
    min-width: 200px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .legal-page {
        padding: 100px 16px 60px;
    }

    .legal-header h1 {
        font-size: 1.75rem;
    }

    .legal-intro {
        padding: 24px 20px;
    }

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

    .legal-card-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .legal-table {
        font-size: 13px;
    }

    .legal-table th,
    .legal-table td {
        padding: 10px 12px;
    }

    .faq-item summary {
        padding: 16px 20px;
        padding-right: 44px;
        font-size: 14px;
    }

    .faq-answer {
        padding: 0 20px 16px;
    }

    .faq-help-box {
        padding: 36px 24px;
    }

    .faq-help-actions {
        flex-direction: column;
        gap: 12px;
    }

    .faq-help-actions .btn {
        width: 100%;
        min-width: 0;
    }
}
