/* ============================================
   WAVE LIGHT - Legal Pages & Cookie Banner CSS
   ============================================ */

/* === LEGAL PAGES (Privacy Policy, Cookie Policy) === */
.legal-page {
    padding-top: 120px;
    padding-bottom: 4rem;
    min-height: 100vh;
}

.legal-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.legal-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.legal-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    max-width: 600px;
    margin: 0 auto;
}

.legal-update {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.4);
    margin-top: 1rem;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99,102,241,0.25);
}

.legal-section h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.9);
}

.legal-section p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.75rem;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

.legal-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(99,102,241,0.6);
}

.legal-section a {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-section a:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.legal-section code {
    background: rgba(255,255,255,0.08);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #c4b5fd;
}

.legal-info-box {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
}

.legal-info-box p {
    margin: 0;
    color: rgba(255,255,255,0.85);
}

.legal-info-box a {
    color: #818cf8;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.legal-table th,
.legal-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}

.legal-table th {
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.04);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.legal-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.btn-back-home {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.btn-back-home:hover {
    color: #fff;
}

/* === COOKIE CONSENT BANNER === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #0f172a;
    border-top: 1px solid rgba(99,102,241,0.25);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.cookie-banner-main {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.cookie-banner-text p {
    font-size: 0.8375rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

.cookie-banner-text a {
    color: #818cf8;
    text-decoration: none;
}

.cookie-banner-text a:hover {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-size: 0.8375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    min-width: 180px;
}

.cookie-btn-accept {
    background: #6366f1;
    color: #fff;
}

.cookie-btn-accept:hover {
    background: #4f46e5;
}

.cookie-btn-reject {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
}

.cookie-btn-reject:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
}

.cookie-btn-settings {
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.375rem 1rem;
}

.cookie-btn-settings:hover {
    color: rgba(255,255,255,0.8);
}

/* Cookie Settings Detail Panel */
.cookie-settings-panel {
    display: none;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.cookie-settings-panel.open {
    display: block;
}

.cookie-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.cookie-category-info p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
    line-height: 1.5;
}

/* Custom Toggle Switch */
.cookie-toggle {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 24px;
    transition: background 0.25s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #6366f1;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle input:disabled:checked + .cookie-toggle-slider {
    background: #6366f1;
}

.cookie-save-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
}

/* Close button (X) for banner — Garante requirement */
.cookie-banner-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.cookie-banner-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Footer manage cookie link */
.footer-cookie-manage {
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    text-decoration: none;
}

.footer-cookie-manage:hover {
    text-decoration: underline;
    color: #fff;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .legal-page { padding-top: 100px; }

    .cookie-banner-main {
        flex-direction: column;
        gap: 1rem;
    }

    .cookie-banner-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }

    .cookie-banner-inner {
        padding: 1.25rem 1rem;
        padding-right: 2.5rem;
    }

    .legal-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .legal-section h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .legal-page { padding-top: 80px; padding-bottom: 2rem; }
    .legal-content { padding: 0 0.5rem; }
}
