/* ================================================================== */
/*  Download-gate modal                                                */
/*  Email-capture overlay shown when a user clicks a gated PDF link.   */
/*  Activates via js/download-modal.js. Hidden by default.             */
/* ================================================================== */

.dl-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.dl-modal[hidden] { display: none; }

.dl-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 18, 32, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: dlFadeIn var(--dur-fast) var(--ease-out) both;
}

.dl-modal__panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 32px 28px 28px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -20px rgba(11, 18, 32, 0.45);
    animation: dlRise var(--dur-med) var(--ease-out) both;
}

.dl-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-base);
    transition: background-color var(--dur-fast) var(--ease-out);
}
.dl-modal__close:hover { background: var(--surface); color: var(--text); }
[dir="rtl"] .dl-modal__close { right: auto; left: 12px; }

.dl-modal__eyebrow {
    margin: 0 0 8px;
    font-size: var(--fs-eyebrow);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-caps);
    text-transform: uppercase;
    color: var(--accent-amber);
}
.dl-modal__title {
    margin: 0 0 8px;
    font-size: var(--fs-h2);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-heading);
    color: var(--text);
}
.dl-modal__lead {
    margin: 0 0 20px;
    font-size: var(--fs-body-sm);
    line-height: var(--lh-loose);
    color: var(--text-muted);
}

.dl-modal__form { display: flex; flex-direction: column; gap: 12px; }

/* Honeypot anti-bot field — hidden from real users (clipped, 1×1, opacity 0).
   Bots fill every field they find; the server drops submissions where this
   non-empty. Class-based (not inline style) so it passes a strict CSP.
   Clip-path instead of an off-screen offset — a left offset extends the
   scrollable canvas on RTL pages (Arabic). */
.dl-modal__honey {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    pointer-events: none;
}

.dl-modal__label {
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-medium);
    color: var(--text);
}
.dl-modal__req { color: var(--color-error); margin-left: 3px; }
[dir="rtl"] .dl-modal__req { margin-left: 0; margin-right: 3px; }

.dl-modal__input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--fs-body-sm);
    color: var(--text);
    transition:
        background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out);
}
.dl-modal__input::placeholder { color: var(--text-muted); }
.dl-modal__input:hover { background: var(--input-bg-hover); }
.dl-modal__input:focus,
.dl-modal__input:focus-visible {
    outline: 0;
    background: var(--input-bg-focus);
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(26, 75, 181, 0.15);
}

.dl-modal__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
    font-size: var(--fs-caption);
    line-height: var(--lh-snug);
    color: var(--text-muted);
    cursor: pointer;
}
.dl-modal__consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.dl-modal__error {
    margin: 0;
    padding: 10px 12px;
    background: var(--bg-error-subtle);
    border: 1px solid var(--border-error);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    font-size: var(--fs-caption);
    line-height: var(--lh-snug);
}

.dl-modal__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 22px;
    line-height: 1.2;
    margin-top: 4px;
    background: var(--brand-fill);
    color: #ffffff;
    border: 1px solid var(--brand);
    border-radius: var(--radius-base);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-tight);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset,
                0 8px 18px -10px rgba(4, 44, 113, 0.55);
    transition:
        background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}
.dl-modal__submit:hover {
    background: var(--brand-fill-600);
    border-color: var(--brand-fill-600);
    transform: translateY(-1px);
}
.dl-modal__submit[disabled],
.dl-modal__submit.is-loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.dl-modal__fineprint {
    margin: 8px 0 0;
    font-size: var(--fs-caption);
    color: var(--text-subtle);
    line-height: var(--lh-snug);
}
.dl-modal__link {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--dur-fast) var(--ease-out);
}
.dl-modal__link:hover { color: var(--accent-amber); }

@keyframes dlFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes dlRise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .dl-modal__overlay,
    .dl-modal__panel { animation: none; }
}
