/**
 * Legal Disclaimers & TOS Gate CSS
 * Include on every authenticated page:
 *   <link rel="stylesheet" href="./00-CORE/css/legal-disclaimers.css">
 */

/* ============================================
   TOS GATE - Blocking Modal
   ============================================ */
#tos-gate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* Freeze everything behind TOS modal — no flashing */
body.tos-gate-active .main-content,
body.tos-gate-active .sidebar,
body.tos-gate-active .topbar,
body.tos-gate-active .global-topbar,
body.tos-gate-active .viewing-as-banner,
body.tos-gate-active #viewingAsBanner,
body.tos-gate-active .lp-legal-footer {
    visibility: hidden;
}
body.tos-gate-active {
    overflow: hidden;
}

.tos-gate-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.tos-gate-header {
    padding: 28px 32px 20px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.tos-gate-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.tos-gate-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px 0;
}

.tos-gate-header p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

.tos-gate-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    min-height: 0;
}

.tos-gate-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tos-gate-content .tos-highlight {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #1e3a5f;
}

.tos-gate-content .tos-highlight.warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #78350f;
}

.tos-gate-content .tos-highlight.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
}

.tos-gate-content .tos-highlight strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.tos-gate-content .tos-highlight p {
    margin: 0 0 10px 0;
}

.tos-gate-content .tos-highlight p:last-child {
    margin-bottom: 0;
}

.tos-gate-content .tos-highlight ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.tos-gate-content .tos-highlight li {
    margin-bottom: 4px;
}

.tos-gate-footer {
    padding: 16px 32px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.tos-gate-divider {
    margin: 28px 0 16px 0;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #166534;
}

.tos-gate-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}

.tos-gate-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    transition: all 0.15s;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #374151;
}

.tos-gate-check:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.tos-gate-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: #3b82f6;
}

.tos-gate-check strong {
    color: #111827;
}

.tos-gate-check a {
    color: #2563eb;
    text-decoration: underline;
}

.tos-gate-accept {
    width: 100%;
    padding: 14px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tos-gate-accept:hover:not(:disabled) {
    background: #2563eb;
}

.tos-gate-accept:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.tos-gate-decline {
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.82rem;
    cursor: pointer;
    margin-top: 8px;
}

.tos-gate-decline:hover {
    color: #ef4444;
    text-decoration: underline;
}

.tos-gate-version {
    text-align: center;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 12px;
}


/* ============================================
   FOOTER DISCLAIMER - Every page
   ============================================ */
.lp-legal-footer {
    padding: 12px 20px;
    background: #fef3c7;
    border-top: 1px solid #fcd34d;
    margin-top: auto;
    flex-shrink: 0;
}

.lp-legal-footer-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #92400e;
}

.lp-legal-footer-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.lp-legal-footer-text {
    flex: 1;
}

.lp-legal-footer-text a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}


/* ============================================
   CONTEXTUAL DISCLAIMERS - Feature-specific
   ============================================ */
.lp-ctx-disclaimer {
    margin-bottom: 16px;
}

.lp-ctx-disclaimer-inner {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #78350f;
}

.lp-ctx-disclaimer-inner strong {
    color: #92400e;
}


/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .tos-gate-modal {
        max-height: 95vh;
    }
    
    .tos-gate-header {
        padding: 20px 16px 16px;
    }
    
    .tos-gate-header h2 {
        font-size: 1.15rem;
    }
    
    .tos-gate-scroll {
        padding: 16px;
    }
    
    .tos-gate-footer {
        padding: 16px;
    }
    
    .tos-gate-check {
        font-size: 0.78rem;
        padding: 8px 10px;
    }
    
    .lp-legal-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}
