/* PepStation age & research-use gate. Uses the theme's fonts when available. */

/* Retire the previous gate (printed by the old Astra child theme) so only one shows. */
#psAgeOverlay, .ps-age-overlay { display: none !important; }
html:not(.ps-gate-locked) body.ps-age-locked { overflow: auto !important; }
.ps-gate {
  --g-ink: #0E1220; --g-ink-2: #4A5064; --g-ink-3: #7A8093;
  --g-line: #E6E8EE; --g-brand: #2B45E0; --g-tint: #F3F5FF; --g-tint-line: #DCE2FF; --g-danger: #B42318;
  position: fixed; inset: 0; z-index: 2147483000;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(14, 18, 32, 0.38);
  font-family: var(--ps-font-body, "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
  color: var(--g-ink);
  -webkit-font-smoothing: antialiased;
}
.ps-gate[hidden] { display: none; }
html.ps-gate-locked .ps-gate,
.ps-gate.is-open { display: flex; }
.ps-gate.is-open { animation: ps-g-fade .25s ease-out; }

html.ps-gate-locked, html.ps-gate-locked body { overflow: hidden; }
html.ps-gate-locked body > *:not(.ps-gate):not(script):not(style) { filter: blur(14px) saturate(.9); pointer-events: none; user-select: none; }

.ps-gate *, .ps-gate *::before, .ps-gate *::after { box-sizing: border-box; }

.ps-gate__card {
  width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; border: 1px solid var(--g-line); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(14,18,32,.04), 0 24px 64px -16px rgba(14,18,32,.28);
  padding: 36px 32px 24px; text-align: center;
  animation: ps-g-rise .3s cubic-bezier(.2,.8,.2,1);
}
.ps-gate__mark { width: 56px; height: auto; display: block; margin: 0 auto 22px; }

.ps-gate__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--g-ink-3); margin: 0 0 12px;
}
.ps-gate__eyebrow::before, .ps-gate__eyebrow::after { content: ""; width: 18px; height: 1px; background: var(--g-line); }

.ps-gate__title {
  font-family: var(--ps-font-display, "Switzer", var(--ps-font-body, system-ui), sans-serif);
  font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: -0.015em;
  margin: 0 0 10px; color: var(--g-ink); text-transform: none;
}
.ps-gate__lede { font-size: 15px; line-height: 1.55; color: var(--g-ink-2); margin: 0 auto 22px; max-width: 340px; }

.ps-gate__checks { display: grid; gap: 10px; margin: 0 0 20px; text-align: left; }
.ps-check {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--g-line); border-radius: 14px;
  cursor: pointer; transition: border-color .15s, background .15s; margin: 0;
}
.ps-check:hover { border-color: #CBD0DB; }
.ps-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ps-check__box {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px;
  border: 1.5px solid #C3C8D4; background: #fff; color: #fff;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.ps-check__box svg { width: 14px; height: 14px; opacity: 0; transition: opacity .1s; }
.ps-check input:checked + .ps-check__box { background: var(--g-brand); border-color: var(--g-brand); }
.ps-check input:checked + .ps-check__box svg { opacity: 1; }
.ps-check input:focus-visible + .ps-check__box { outline: 2px solid var(--g-brand); outline-offset: 2px; }
.ps-check:has(input:checked) { border-color: var(--g-tint-line); background: var(--g-tint); }
.ps-check__text { font-size: 13px; line-height: 1.5; color: var(--g-ink-2); }
.ps-check__text strong { display: block; font-size: 14px; font-weight: 500; color: var(--g-ink); }

.ps-gate__actions { display: grid; gap: 6px; }
.ps-gbtn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: 500 15px/1 var(--ps-font-body, "DM Sans", system-ui, sans-serif);
  min-height: 50px; padding: 0 20px; border-radius: 12px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.ps-gbtn:focus-visible { outline: 2px solid var(--g-brand); outline-offset: 3px; }
.ps-gbtn--primary { background: var(--g-ink); color: #fff; }
.ps-gbtn--primary:hover { background: #222842; }
.ps-gbtn--primary:disabled { background: #E9EBF0; color: #9AA0AE; cursor: not-allowed; }
.ps-gbtn--ghost { background: #fff; color: var(--g-ink-2); border-color: var(--g-line); }
.ps-gbtn--ghost:hover { border-color: #CBD0DB; color: var(--g-ink); }
.ps-gbtn--link { background: none; color: var(--g-ink-3); min-height: 40px; font-size: 13px; }
.ps-gbtn--link:hover { color: var(--g-ink); }

.ps-gate__legal {
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--g-line);
  font-size: 12px; line-height: 1.5; color: var(--g-ink-3);
}
.ps-gate__legal a { color: var(--g-ink-2); text-decoration: underline; text-underline-offset: 2px; }

.ps-gate__denied { display: none; }
.ps-gate.is-denied .ps-gate__main { display: none; }
.ps-gate.is-denied .ps-gate__denied { display: block; animation: ps-g-fade .2s ease-out; }
.ps-gate__denied-icon {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center; background: #FEF3F2; color: var(--g-danger);
}

@keyframes ps-g-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes ps-g-rise { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes ps-g-sheet { from { transform: translateY(100%) } to { transform: none } }
@media (prefers-reduced-motion: reduce) { .ps-gate, .ps-gate__card { animation: none !important; } }

@media (max-width: 480px) {
  .ps-gate { align-items: flex-end; padding: 0; }
  .ps-gate__card {
    max-width: none; max-height: 100vh; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
    animation-name: ps-g-sheet;
  }
  .ps-gate__title { font-size: 24px; }
  .ps-gate__mark { width: 48px; margin-bottom: 18px; }
}
