/* Gated white paper download form (inc/download-gate.php). */
.aai-dl {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0;
  color: var(--text-primary, #fff); background: var(--surface-card, #17181b);
  border: 1px solid var(--border-strong, #2c2d31); border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); overflow: auto; overscroll-behavior: contain;
}
/* .rs-form sets display:flex, which would beat the hidden attribute. */
.aai-dl [hidden] { display: none !important; }
.aai-dl::backdrop { background: rgba(5, 6, 8, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.aai-dl[open] { animation: aai-dl-in .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes aai-dl-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.aai-dl__form, .aai-dl__done { padding: clamp(24px, 5vw, 36px); }
.aai-dl__x {
  position: absolute; top: 12px; right: 12px; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted, #a1a1aa); cursor: pointer;
}
.aai-dl__x:hover { background: rgba(255, 255, 255, .08); color: var(--text-primary, #fff); }
.aai-dl__x:focus-visible { outline: 2px solid var(--accent, #0082ff); outline-offset: 2px; }

.aai-dl__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent, #0082ff); }
.aai-dl__h { margin: 8px 44px 0 0; font-size: clamp(22px, 4.6vw, 28px); line-height: 1.2; letter-spacing: -.01em; }
.aai-dl__h [data-aai-dl-name] { color: var(--accent, #0082ff); }
.aai-dl__lede { margin: 10px 0 0; color: var(--text-secondary, #d4d4d8); font-size: 15.5px; line-height: 1.55; }

.aai-dl__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; margin-top: 6px; }
.aai-dl__check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 14.5px; line-height: 1.5; color: var(--text-secondary, #d4d4d8); cursor: pointer; }
.aai-dl__check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent, #0082ff); cursor: pointer; }
.aai-dl__err { margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 14.5px; background: rgba(229, 72, 77, .12); box-shadow: inset 0 0 0 1px var(--danger, #e5484d); color: #f6c9cb; }
.aai-dl__fine { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-muted, #a1a1aa); }
.aai-dl__fine a { color: inherit; text-decoration: underline; }
.aai-dl__form.is-busy [type="submit"] { opacity: .7; cursor: progress; }

.aai-dl__done { text-align: center; }
.aai-dl__done .aai-dl__h { margin-right: 0; }
.aai-dl__done .aai-btn { margin-top: 22px; }
.aai-dl__tick {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0, 130, 255, .14); color: var(--accent, #0082ff); margin-bottom: 6px;
}

@media (max-width: 560px) {
  .aai-dl__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .aai-dl[open] { animation: none; }
}
