:root {
    --whitepaper-ink: #363646;
    --whitepaper-muted: #727281;
    --whitepaper-yellow: #ffd36a;
    --whitepaper-cream: #fffbee;
}

body.whitepaper-gate-open { overflow: hidden; }

.whitepaper-gate[hidden],
.whitepaper-gate [hidden] { display: none !important; }

.whitepaper-gate {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .22s ease;
}

.whitepaper-gate.is-open { opacity: 1; }

.whitepaper-gate__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(29, 29, 39, .72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.whitepaper-gate__dialog {
    position: relative;
    width: min(100%, 720px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 48px 52px 50px;
    border: 1px solid rgba(255, 211, 106, .55);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 211, 106, .3), transparent 34%),
        #fff;
    box-shadow: 0 32px 90px rgba(20, 20, 29, .32);
    transform: translateY(18px) scale(.98);
    transition: transform .22s ease;
    outline: none;
}

.whitepaper-gate.is-open .whitepaper-gate__dialog { transform: translateY(0) scale(1); }

.whitepaper-gate__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(54, 54, 70, .13);
    border-radius: 50%;
    background: rgba(255,255,255,.8);
    color: var(--whitepaper-ink);
    font-size: 27px;
    line-height: 32px;
}

.whitepaper-gate__eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--whitepaper-yellow);
    font-family: Mont, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.whitepaper-gate__intro,
.whitepaper-gate__success p {
    margin: 0 0 30px;
}

.whitepaper-gate__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.whitepaper-gate__field { margin: 0; }
.whitepaper-gate__field--wide { grid-column: 1 / -1; }

.whitepaper-gate .wpcf7-form-control-wrap { display: block; }
.whitepaper-gate input[type="text"],
.whitepaper-gate input[type="email"] {
    width: 100%;
    min-height: 57px;
    padding: 18px 32px;
    border: 1px solid rgba(54, 54, 69, 0.1);
    border-radius: 12px;
    background: #fff;
    color: var(--whitepaper-ink);
    font-family: NotoSans, sans-serif;
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.whitepaper-gate input[type="text"]::placeholder,
.whitepaper-gate input[type="email"]::placeholder {
    color: rgba(103, 104, 117, .5);
    opacity: 1;
}
.whitepaper-gate input:focus {
    border-color: var(--whitepaper-yellow);
    outline: none;
}

.whitepaper-gate__consent {
    margin: 22px 0 24px;
    color: var(--whitepaper-muted);
    font-size: 12.5px;
    line-height: 1.55;
}
.whitepaper-gate__consent .wpcf7-list-item { margin: 0; }
.whitepaper-gate__consent label { display: flex; gap: 11px; align-items: flex-start; margin: 0; }
.whitepaper-gate__consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--whitepaper-ink); flex: 0 0 auto; }
.whitepaper-gate__consent a { color: var(--whitepaper-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.whitepaper-gate__submit,
.whitepaper-gate__download {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 13px 22px;
    border: 0;
    border-radius: 11px;
    background: var(--whitepaper-yellow);
    color: var(--whitepaper-ink);
    font-family: Mont, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    transition: transform .2s ease, box-shadow .2s ease;
}
.whitepaper-gate__submit:hover,
.whitepaper-gate__download:hover { color: var(--whitepaper-ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(198, 146, 25, .24); }
.whitepaper-gate .wpcf7-spinner { margin: 0 0 0 12px; vertical-align: middle; }
.whitepaper-gate .wpcf7-not-valid-tip { margin-top: 6px; font-size: 12px; }
.whitepaper-gate .wpcf7-response-output { margin: 18px 0 0 !important; border-radius: 10px; font-size: 13px; }

.whitepaper-gate__success { padding: 22px 10px 12px; text-align: center; }
.whitepaper-gate__success h2 { margin-inline: auto; }
.whitepaper-gate__success p { margin-bottom: 26px; }
.whitepaper-gate__check {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    margin: 0 auto 24px;
    border-radius: 22px;
    background: var(--whitepaper-cream);
    color: var(--whitepaper-ink);
}
.whitepaper-gate__check svg { width: 45px; height: 45px; }
.whitepaper-gate__check path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.whitepaper-gate__arrow {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: var(--whitepaper-ink);
    color: #fff;
    font-size: 18px;
}

@media (max-width: 640px) {
    .whitepaper-gate { padding: 12px; }
    .whitepaper-gate__dialog { max-height: calc(100vh - 24px); padding: 38px 20px 28px; border-radius: 18px; }
    .whitepaper-gate__fields { grid-template-columns: 1fr; gap: 15px; }
    .whitepaper-gate__field--wide { grid-column: auto; }
    .whitepaper-gate__intro { margin-bottom: 22px; }
    .whitepaper-gate__submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .whitepaper-gate,
    .whitepaper-gate__dialog,
    .whitepaper-gate__submit,
    .whitepaper-gate__download { transition: none; }
}
