:root {
  --afl-gate-bg: #06071A;
  --afl-gate-panel: #0D0E26;
  --afl-gate-card: #10112C;
  --afl-gate-border: #282B58;
  --afl-gate-blue: #1E64FF;
  --afl-gate-blue-light: #4484FF;
  --afl-gate-red: #CC1010;
  --afl-gate-red-light: #FF5A5A;
  --afl-gate-text: #E2EAFA;
  --afl-gate-muted: #A6B1D3;
}

body.afl-gate-locked { overflow: hidden !important; }
.afl-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 20%, rgba(30,100,255,.16), transparent 42%),
    radial-gradient(circle, rgba(30,100,255,.06) 1px, transparent 1px),
    var(--afl-gate-bg);
  background-size: auto, 30px 30px, auto;
  padding:
    max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  display: none;
  place-items: center;
}
.afl-gate-overlay.is-active { display: grid; }

.afl-gate-dialog {
  width: min(620px, 100%);
  max-height: none;
  background: linear-gradient(180deg, rgba(16,17,44,.98), rgba(9,9,30,.99));
  border: 1px solid var(--afl-gate-border);
  border-top: 3px solid var(--afl-gate-blue);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: 0 24px 80px rgba(0,0,0,.55), 0 0 80px rgba(30,100,255,.08);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  outline: none;
}

.afl-gate-kicker {
  font-family: "IBM Plex Mono", monospace;
  color: var(--afl-gate-blue-light);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.afl-gate-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  color: var(--afl-gate-red-light);
  border: 1px solid var(--afl-gate-red);
  background: rgba(204,16,16,.1);
  padding: 7px 18px;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  clip-path: polygon(10% 0,90% 0,100% 50%,90% 100%,10% 100%,0 50%);
  margin-bottom: 22px;
}
.afl-gate-dialog h2 {
  margin: 0 0 12px;
  color: var(--afl-gate-text);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(34px, 7vw, 50px);
  letter-spacing: .04em;
  line-height: .95;
}
.afl-gate-dialog > p { margin: 0; }
#afl-gate-description {
  color: var(--afl-gate-muted);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  max-width: 52ch;
}
.afl-gate-checks {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}
.afl-gate-checks label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: rgba(16,17,44,.68);
  border: 1px solid var(--afl-gate-border);
  color: var(--afl-gate-muted);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}
.afl-gate-checks input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--afl-gate-blue);
}
.afl-gate-actions { display: flex; gap: 10px; }
.afl-gate-actions button {
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.afl-gate-confirm {
  flex: 1;
  background: var(--afl-gate-blue);
  color: var(--afl-gate-bg);
}
.afl-gate-confirm:hover:not(:disabled) { background: var(--afl-gate-blue-light); }
.afl-gate-confirm:disabled { opacity: .42; cursor: not-allowed; }
.afl-gate-exit { background: transparent; color: var(--afl-gate-muted); border-color: var(--afl-gate-border) !important; }
.afl-gate-exit:hover { color: var(--afl-gate-red-light); border-color: var(--afl-gate-red) !important; }
.afl-gate-status {
  min-height: 24px;
  margin-top: 12px !important;
  color: var(--afl-gate-muted);
  font: 12px/1.5 "IBM Plex Mono", monospace;
}
.afl-gate-status.is-error { color: var(--afl-gate-red-light); }
.afl-gate-fineprint {
  margin-top: 14px !important;
  color: var(--afl-gate-muted);
  opacity: .82;
  font: 11px/1.55 "IBM Plex Mono", monospace;
}
.afl-gate-dialog :focus-visible {
  outline: 3px solid var(--afl-gate-blue-light);
  outline-offset: 3px;
}
@media (max-width: 560px) {
  .afl-gate-overlay { place-items: start center; }
  .afl-gate-dialog { padding: 26px 20px; margin: auto 0; }
  .afl-gate-actions { flex-direction: column; }
  .afl-gate-exit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .afl-gate-overlay *, .afl-gate-overlay *::before, .afl-gate-overlay *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Optional Research Network capture: visually related to the gate, but kept
   distinct from the three required RUO acknowledgments. */
.afl-gate-network {
  margin: -8px 0 26px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(30,100,255,.10), rgba(16,17,44,.76));
  border: 1px solid rgba(68,132,255,.48);
}
.afl-gate-network-label {
  margin-bottom: 10px;
  color: var(--afl-gate-blue-light);
  font: 700 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.afl-gate-network-choice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--afl-gate-text);
  font: 600 15px/1.45 "Barlow Semi Condensed", sans-serif;
  cursor: pointer;
}
.afl-gate-network-choice input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--afl-gate-blue);
}
.afl-gate-network-email {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(68,132,255,.25);
}
.afl-gate-network-email[hidden] { display: none !important; }
.afl-gate-network-email > label {
  display: block;
  margin-bottom: 7px;
  color: var(--afl-gate-muted);
  font: 700 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.afl-gate-network-email input[type="email"] {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  border: 1px solid var(--afl-gate-border);
  background: rgba(6,7,26,.72);
  color: var(--afl-gate-text);
  padding: 10px 12px;
  font: 16px/1.3 "Barlow Semi Condensed", sans-serif;
  border-radius: 0;
}
.afl-gate-network-email input[type="email"]::placeholder { color: #7f8aae; }
.afl-gate-network-email p {
  margin: 8px 0 0;
  color: var(--afl-gate-muted);
  font: 11px/1.45 "IBM Plex Mono", monospace;
}

.afl-gate-noscript {
  position: fixed; inset: 0; z-index: 2147483646; display: grid; place-items: center;
  padding: 24px; background: #06071A; color: #E2EAFA; text-align: center;
  font: 14px/1.6 "IBM Plex Mono", monospace;
}

/* v2.3.3 paint-safety: the synchronous head bootstrap owns first-paint state. */
html.afl-gate-ui-ack .afl-gate-overlay { display: none !important; }
html.afl-gate-ui-new { background: #06071A; }
html.afl-gate-ui-new body > *:not(.afl-gate-overlay):not(.afl-gate-noscript) { visibility: hidden !important; }
html.afl-gate-ui-new .afl-gate-overlay,
html.afl-gate-ui-new .afl-gate-noscript { visibility: visible !important; }
