/* =============================================================
   LEGAL CONTENT — Terms of Use / Privacy Policy
   Shared typography (.legal-content) is used both by the standalone
   page (direct URL) and by the stacked modal opened from Login/Register.
   ============================================================= */
.legal-content h3 {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--slate);
    margin: 20px 0 8px;
    letter-spacing: -.01em;
}
.legal-content h3:first-of-type { margin-top: 0; }
.legal-content p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--slate-600);
    margin-bottom: 12px;
}
.legal-content ol, .legal-content ul {
    margin: 0 0 14px 22px;
}
.legal-content li {
    font-size: 13px;
    line-height: 1.7;
    color: var(--slate-600);
    margin-bottom: 6px;
}
.legal-content strong { color: var(--slate); font-weight: 700; }
.legal-content a { color: var(--emerald-dark); font-weight: 600; text-decoration: underline; }
.legal-content .legal-meta {
    font-size: 11px;
    color: var(--slate-400);
    margin-bottom: 16px;
}

/* ─────────────────────────────────────────────
   STANDALONE PAGE (direct URL navigation)
   ───────────────────────────────────────────── */
.legal-page {
    min-height: 100vh;
    background: var(--slate-50);
    padding-bottom: 60px;
}
.legal-page-hdr {
    background: var(--slate);
    padding: 14px 24px;
}
.legal-page-hdr a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 800;
    font-size: 14.5px;
    text-decoration: none;
}
.legal-page-hdr img {
    height: 22px;
    width: auto;
    object-fit: contain;
    border-radius: 5px;
}
.legal-page-inner {
    max-width: 720px;
    margin: 24px auto 0;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 26px 30px 34px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.legal-back {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--slate-500);
    text-decoration: none;
    margin-bottom: 14px;
}
.legal-back:hover { color: var(--slate); }
.legal-page-inner h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--slate);
    letter-spacing: -.02em;
    margin-bottom: 4px;
}
@media (max-width: 640px) {
    .legal-page-inner { margin: 14px 12px 0; padding: 20px 16px 28px; }
}

/* ─────────────────────────────────────────────
   STACKED MODAL (opened from Login / Register — see index.css
   for the .legal-modal-overlay show/hide + z-index rules)
   ───────────────────────────────────────────── */
.legal-modal-overlay .modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .45);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    padding: 20px;
    animation: legalFadeIn .18s ease;
}
@keyframes legalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.legal-modal-overlay .modal-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 86vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: legalCardIn .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes legalCardIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.legal-modal-overlay .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--slate-100);
    flex-shrink: 0;
}
.legal-modal-overlay .modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--slate);
    letter-spacing: -.02em;
}
.legal-modal-overlay .modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    transition: background .15s;
    margin: -4px -4px 0 8px;
    cursor: pointer;
}
.legal-modal-overlay .modal-close:hover { background: var(--slate-100); }
.legal-modal-overlay .modal-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; }

.legal-modal-overlay .legal-modal-body {
    overflow-y: auto;
    padding: 20px 22px 26px;
}
.legal-modal-overlay .legal-modal-loading,
.legal-modal-overlay .legal-modal-error {
    font-size: 13px;
    color: var(--slate-400);
    text-align: center;
    padding: 30px 0;
}

@media (max-width: 560px) {
    .legal-modal-overlay .modal-backdrop { align-items: flex-end; padding: 0; }
    .legal-modal-overlay .modal-card {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
    }
}
