/* Shared legal modal — Terms & Conditions / Privacy Policy popup.
   Opened by any [data-legal="terms_workspace|terms_candidate|privacy"] link.
   Self-contained; adapts to the host page's theme (data-theme attribute). */

body.hn-legal-lock { overflow: hidden; }

.hn-legal-modal {
    position: fixed; inset: 0; z-index: 4000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(4, 8, 14, 0.62);
    backdrop-filter: blur(6px);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
.hn-legal-modal[hidden] { display: none; }

.hn-legal-modal__panel {
    width: min(760px, 100%);
    max-height: min(86vh, 900px);
    display: flex; flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(187, 201, 224, 0.16);
    background: #0d192a;
    color: #eef2f8;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: hnLegalIn 160ms ease;
}
@keyframes hnLegalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

.hn-legal-modal__head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(187, 201, 224, 0.14);
}
.hn-legal-modal__title {
    margin: 0; font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: #f5f7fb;
}
.hn-legal-modal__close {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid rgba(187, 201, 224, 0.2); background: transparent;
    color: #c5cedc; font-size: 22px; line-height: 1; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.hn-legal-modal__close:hover { background: rgba(114, 223, 205, 0.12); color: #f5f7fb; border-color: rgba(114, 223, 205, 0.5); }

.hn-legal-modal__body {
    padding: 22px 24px 28px; overflow-y: auto; line-height: 1.7; font-size: 14.5px; color: #cdd6e2;
}
.hn-legal-modal__body h3 {
    margin: 22px 0 8px; font-size: 15px; font-weight: 700; color: #f5f7fb;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}
.hn-legal-modal__body h3:first-child { margin-top: 0; }
.hn-legal-modal__body p { margin: 0 0 12px; }
.hn-legal-modal__body ul { margin: 6px 0 14px; padding-left: 20px; }
.hn-legal-modal__body li { margin-bottom: 6px; }
.hn-legal-modal__body strong { color: #f0f4fa; }

/* Light theme */
.hn-legal-modal[data-theme="light"] .hn-legal-modal__panel {
    background: #ffffff; color: #1a2431; border-color: rgba(29, 65, 92, 0.14);
    box-shadow: 0 40px 120px rgba(39, 74, 100, 0.24);
}
.hn-legal-modal[data-theme="light"] .hn-legal-modal__head { border-bottom-color: rgba(29, 65, 92, 0.12); }
.hn-legal-modal[data-theme="light"] .hn-legal-modal__title { color: #10233a; }
.hn-legal-modal[data-theme="light"] .hn-legal-modal__close { border-color: rgba(29, 65, 92, 0.18); color: #4a5b6d; }
.hn-legal-modal[data-theme="light"] .hn-legal-modal__close:hover { background: rgba(0, 174, 181, 0.1); color: #10233a; border-color: rgba(0, 174, 181, 0.5); }
.hn-legal-modal[data-theme="light"] .hn-legal-modal__body { color: #3a4a5b; }
.hn-legal-modal[data-theme="light"] .hn-legal-modal__body h3 { color: #10233a; }
.hn-legal-modal[data-theme="light"] .hn-legal-modal__body strong { color: #14283d; }

@media (max-width: 560px) {
    .hn-legal-modal { padding: 0; }
    .hn-legal-modal__panel { max-height: 100vh; height: 100vh; border-radius: 0; width: 100%; }
}
