  /*
 * Agent Voice — email gate (locked state only).
 * Port of the approved v5 preview's gate CSS. Everything is scoped under
 * `.av .gate` so it can't restyle the theme, and resets the base element
 * styles the theme sets (p padding/line-height, h2, inputs) so the gate
 * looks identical to v5. The gate is a fixed full-screen overlay above
 * the theme header/footer and any widget, so nothing behind it is
 * readable or reachable.
 */

/* page scroll locked while the gate is up (v5: body.gated) */
html:has(body.av-gated),
body.av-gated {
  overflow: hidden;
}

.av .gate {
  --space: #0f1330; --midnight: #20264c; --raised: #1a2048; --track: #141a3d;
  --arctic: #6fc6d0; --sunrise: #f59d1d; --coral: #e72d5d;
  --snow: #ffffff; --soft: #d8dbe8; --muted: #b4b9cc; --faint: #9096b4;
  --ease: cubic-bezier(.2,.8,.2,1);

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: linear-gradient(#0f1330a0, #0f1330a0), url(/wp-content/plugins/agent-voice/assets/img/gate-bg.jpg) center/cover no-repeat #0f1330;
  transition: opacity .6s var(--ease);

  /* v5 body base */
  color: var(--snow);
  font-family: Poppins, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* v5 reset: *{box-sizing:border-box;margin:0;padding:0} */
.av .gate *,
.av .gate *::before,
.av .gate *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.av .gate p,
.av .gate label {
  font-family: inherit;
  line-height: 1.6;
  color: inherit;
}
.av .gate button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.av .gate.out { opacity: 0; pointer-events: none; }

.av .gate__card {
  position: relative;
  width: min(540px, 100%);
  background: var(--raised);
  border: 1px solid #ffffff14;
  border-radius: 26px;
  padding: clamp(24px, 3vw, 34px);
  box-shadow: 0 40px 100px -30px #000c;
  animation: avGateIn .7s var(--ease) both;
}
@keyframes avGateIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }

/* deck motifs used on the gate */
.av .gate .bar.sm { width: 48px; height: 6px; border-radius: 3px; background: var(--sunrise); }
.av .gate .eyebrow {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--arctic);
}

.av .gate h1,
.av .gate h2 {
  font-family: inherit;
  font-size: clamp(22px, 2.3vw, 28px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.12;
  text-transform: none;
  color: var(--snow);
  margin: 14px 0 10px;
}
.av .gate .gate__lead { color: var(--soft); font-size: 14.5px; line-height: 1.5; }

.av .gate form { margin-top: 16px; display: grid; gap: 10px; }
.av .gate label.lbl {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.av .gate input[type=email],
.av .gate input[type=text],
.av .gate select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--track);
  border: 2px solid #ffffff1f;
  box-shadow: none;
  color: var(--snow);
  font: inherit;
  font-size: 15px;
  line-height: normal;
  outline: none;
  transition: border-color .2s;
}
.av .gate input[type=email]::placeholder { color: #757575; opacity: 1; }
.av .gate input[type=email]:focus,
.av .gate input[type=text]:focus,
.av .gate select:focus { border-color: var(--arctic); }
.av .gate select {
  padding-right: 44px;
  background: var(--track) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b4b9cc' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center;
  cursor: pointer;
}
.av .gate select option { background: #1a2048; color: #fff; }
.av .gate select:invalid { color: #8a90ad; }

/* styled dropdowns (agent-voice-gate.js); the real <select> stays in the form, visually hidden */
.av .gate .dd { position: relative; }
.av .gate .dd__native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }
.av .gate button.dd__btn {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 40px 0 14px;
  border-radius: 12px;
  background: var(--track) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b4b9cc' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center;
  border: 2px solid #ffffff1f;
  color: var(--snow);
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .2s;
}
.av .gate button.dd__btn.is-empty { color: #8a90ad; }
.av .gate button.dd__btn:focus-visible,
.av .gate .dd.is-open button.dd__btn { border-color: var(--arctic); outline: none; }
.av .gate button.dd__btn[aria-invalid=true] { border-color: var(--coral); }
.av .gate .dd__pop {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #232a5a;
  border: 1px solid #ffffff26;
  border-radius: 14px;
  box-shadow: 0 24px 60px -18px #000d;
  padding: 5px;
  animation: avDdIn .16s var(--ease) both;
}
@keyframes avDdIn { from { opacity: 0; transform: translateY(-4px); } }
.av .gate input.dd__search {
  height: 36px;
  margin-bottom: 4px;
  border-radius: 9px;
  font-size: 14px;
  padding: 0 12px;
}
.av .gate .dd__list { list-style: none; margin: 0; padding: 0; max-height: 176px; overflow-y: auto; outline: none; scrollbar-width: thin; scrollbar-color: #ffffff33 transparent; }
.av .gate .dd__list li {
  position: relative;
  padding: 7px 12px 7px 32px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--soft);
  cursor: pointer;
}
.av .gate .dd__list li[hidden] { display: none; }
.av .gate .dd__list li.is-active { background: #ffffff14; color: var(--snow); }
.av .gate .dd__list li[aria-selected=true] { color: var(--arctic); font-weight: 600; }
.av .gate .dd__list li[aria-selected=true]::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 10px;
  height: 6px;
  border: solid var(--arctic);
  border-width: 0 0 2px 2px;
  transform: translateY(-70%) rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) { .av .gate .dd__pop { animation: none; } }
.av .gate input[aria-invalid=true] { border-color: var(--coral); }

/* honeypot: off-screen, never visible or focusable by people */
.av .gate .gate__hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.av .gate .gate__err { min-height: 18px; font-size: 13px; color: #f08aa3; font-weight: 500; }
.av .gate__go {
  height: 48px;
  border-radius: 999px;
  background: var(--arctic);
  color: var(--midnight);
  font-weight: 700;
  font-size: 16px;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.av .gate button.gate__go { background: var(--arctic); color: var(--midnight); font-weight: 700; font-size: 15px; }
.av .gate__go:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px #6fc6d0aa; }
.av .gate__go[disabled] { opacity: .7; cursor: progress; transform: none; box-shadow: none; }
.av .gate .gate__small { font-size: 12px; color: var(--faint); margin-top: 4px; line-height: 1.5; }
.av .gate .gate__small a { color: var(--arctic); text-decoration: underline; text-underline-offset: 2px; }

/* thank-you state */
.av .gate__ok { display: none; text-align: center; }
.av .gate.done form,
.av .gate.done .gate__intro { display: none; }
.av .gate.done .gate__ok { display: block; animation: avGateIn .6s var(--ease) both; }
.av .gate__tick {
  width: 76px;
  height: 76px;
  margin: 6px auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6fc6d01f;
  border: 2px solid var(--arctic);
}
.av .gate__tick svg {
  width: 36px;
  height: 36px;
  stroke: var(--arctic);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: avGateTick .6s .25s var(--ease) forwards;
}
@keyframes avGateTick { to { stroke-dashoffset: 0; } }
.av .gate__ok p { color: var(--soft); font-size: 16px; line-height: 1.55; margin-top: 8px; }
.av .gate__ok strong { color: var(--snow); font-weight: 700; overflow-wrap: anywhere; }

/* the email field's arctic border is its focus indicator (as in v5) */
.av .gate a:focus-visible,
.av .gate button:focus-visible {
  outline: 2px solid var(--arctic);
  outline-offset: 3px;
}
.av .gate__ok h2:focus { outline: none; }

/* screen-reader-only status line (announces the thank-you) */
.av .gate .gate__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.av .gate .gate__nojs { margin-top: 26px; }

@media (prefers-reduced-motion: reduce) {
  .av .gate,
  .av .gate * { transition: none !important; animation: none !important; }
  /* with the draw animation off, show the tick fully drawn */
  .av .gate__tick svg { stroke-dashoffset: 0; }
}

/* ---------- FormAssembly form inside the gate ----------
 * FormAssembly's own script injects the form and its stylesheets; these
 * rules (scoped to the gate, !important where its theme insists) restyle
 * it to the gate's design and hide its decorative header/footer. */
.av #gate #av-fa-form { margin-top: 16px; min-height: 120px; }
/* plain loading box with a spinner until FormAssembly's form arrives */
.av #gate #av-fa-form[aria-busy=true] { position: relative; min-height: 300px; border-radius: 14px; background: #ffffff08; border: 1px solid #ffffff12; }
.av #gate #av-fa-form[aria-busy=true]::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid #ffffff2e; border-top-color: var(--arctic); animation: avSpin .8s linear infinite; }
.av #gate #av-fa-form .wFormHeader,
.av #gate #av-fa-form .wFormTitle,
.av #gate #av-fa-form .codesection,
.av #gate #av-fa-form .htmlSection,
.av #gate #av-fa-form .wFormFooter,
.av #gate #av-fa-form .supportInfo { display: none !important; }
.av #gate #av-fa-form .wFormContainer,
.av #gate #av-fa-form .wForm,
.av #gate #av-fa-form .wForm form { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; font: inherit !important; color: var(--snow) !important; }
.av #gate #av-fa-form form { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.av #gate #av-fa-form form > * { grid-column: 1 / -1; }
.av #gate #av-fa-form .oneField { margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; background: none !important; }
.av #gate #av-fa-form .oneField.av-half { grid-column: auto; }
.av #gate #av-fa-form .oneField > br { display: none !important; }
.av #gate #av-fa-form label.preField {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted) !important;
  line-height: 1.3 !important;
}
.av #gate #av-fa-form .reqMark::after { color: var(--coral) !important; }
.av #gate #av-fa-form .inputWrapper { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.av #gate #av-fa-form input[type=text],
.av #gate #av-fa-form input[type=email],
.av #gate #av-fa-form select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: 44px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  background-color: var(--track) !important;
  border: 2px solid #ffffff1f !important;
  color: var(--snow) !important;
  font: inherit !important;
  font-size: 15px !important;
  box-shadow: none !important;
}
.av #gate #av-fa-form input:focus { border-color: var(--arctic) !important; outline: none !important; }
.av #gate #av-fa-form .errFld input,
.av #gate #av-fa-form .errFld select,
.av #gate #av-fa-form .errFld button.dd__btn,
.av #gate #av-fa-form [aria-invalid=true] { border-color: var(--coral) !important; }
.av #gate #av-fa-form .errMsg { color: #f08aa3 !important; font-size: 12.5px !important; margin-top: 2px; background: none !important; padding: 0 !important; }
/* country search (FormAssembly autosuggest) */
.av #gate #av-fa-form .twitter-typeahead { display: block !important; width: 100% !important; }
.av #gate #av-fa-form .twitter-typeahead input { width: 100% !important; }
.av #gate #av-fa-form .wfAutosuggest.tt-input { padding-left: 38px !important; background-color: transparent !important; }
.av #gate #av-fa-form .tt-search { left: 14px !important; right: auto !important; position: absolute !important; }
.av #gate #av-fa-form .tt-clear { right: 14px !important; left: auto !important; position: absolute !important; }
.av #gate #av-fa-form .inputWrapper { position: relative; }
.av #gate #av-fa-form .tt-hint { color: #8a90ad !important; }
.av #gate #av-fa-form .tt-search,
.av #gate #av-fa-form .tt-clear,
.av #gate #av-fa-form .tt-spinner { color: var(--muted) !important; top: 14px !important; }
.av #gate #av-fa-form .tt-menu {
  width: 100% !important;
  margin-top: 6px !important;
  max-height: 176px;
  overflow-y: auto;
  background: #232a5a !important;
  border: 1px solid #ffffff26 !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 60px -18px #000d !important;
  padding: 5px !important;
  z-index: 6 !important;
}
.av #gate #av-fa-form .tt-menu { scrollbar-width: none; -ms-overflow-style: none; }
.av #gate #av-fa-form .tt-menu::-webkit-scrollbar { display: none; width: 0; height: 0; }
.av #gate #av-fa-form .tt-more-message { padding: 8px 12px 4px !important; margin-top: 4px; border-top: 1px solid #ffffff1f !important; background: none !important; color: var(--muted) !important; font-size: 12px !important; line-height: 1.4; }
.av #gate #av-fa-form .tt-suggestion { padding: 7px 12px !important; border-radius: 8px; font-size: 14px !important; color: var(--soft) !important; cursor: pointer; }
.av #gate #av-fa-form .tt-suggestion:hover,
.av #gate #av-fa-form .tt-cursor { background: #ffffff14 !important; color: var(--snow) !important; }
/* consent checkbox */
.av #gate #av-fa-form .choices { display: block !important; width: 100%; }
.av #gate #av-fa-form .oneChoice { display: grid !important; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.av #gate #av-fa-form .oneChoice input[type=checkbox] { width: 16px; height: 16px; margin: 2px 0 0 !important; accent-color: var(--arctic); position: static !important; opacity: 1 !important; }
.av #gate #av-fa-form .input-checkbox-faux { display: none !important; }
.av #gate #av-fa-form label.postField { display: block !important; font-size: 12.5px !important; line-height: 1.45 !important; color: var(--soft) !important; font-weight: 400 !important; text-transform: none !important; letter-spacing: 0 !important; margin: 0 !important; padding: 0 !important; }
.av #gate #av-fa-form label.postField a { color: var(--arctic) !important; text-decoration: underline; }
.av #gate #av-fa-form label.postField > div { display: inline !important; }
.av #gate #av-fa-form label.postField > div::after { content: " "; }
/* submit button */
.av #gate #av-fa-form .actions { margin: 6px 0 0 !important; padding: 0 !important; text-align: left !important; background: none !important; }
.av #gate #av-fa-form .actions .primaryAction {
  width: 100% !important;
  height: 48px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--arctic) !important;
  color: var(--midnight) !important;
  font: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform .2s, box-shadow .2s;
}
.av #gate #av-fa-form .actions { position: relative; }
.av #gate #av-fa-form .actions .primaryAction:disabled { opacity: .45 !important; cursor: not-allowed !important; transform: none !important; box-shadow: none !important; }
.av #gate #av-fa-form .actions.is-busy .primaryAction { opacity: .85; cursor: progress; pointer-events: none; padding-left: 28px !important; }
.av #gate #av-fa-form .actions.is-busy::after { content: ""; position: absolute; top: 50%; left: calc(50% - 74px); width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid #20264c55; border-top-color: var(--midnight); animation: avSpin .8s linear infinite; pointer-events: none; }
.av #gate #av-fa-form .actions .primaryAction:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px #6fc6d0aa !important; }
@media (max-width: 560px) { .av #gate #av-fa-form form { grid-template-columns: 1fr; } .av #gate #av-fa-form .oneField.av-half { grid-column: 1 / -1; } }

/* FormAssembly's ALTCHA spam check runs invisibly on submit; its badge is
 * hidden. Only its rare "Verification failed" message can appear, under the
 * button. The widget stays in the form (not display:none) so it keeps working. */
.av #gate #av-fa-form altcha-widget { position: static !important; right: auto !important; bottom: auto !important; grid-column: 1 / -1; display: block; box-shadow: none !important; z-index: auto !important; --altcha-color-base: transparent; --altcha-color-border: transparent; }
.av #gate #av-fa-form altcha-widget .altcha { background: transparent !important; border: 0 !important; padding: 0 !important; max-width: none; min-height: 0; }
.av #gate #av-fa-form altcha-widget .altcha-main,
.av #gate #av-fa-form altcha-widget .altcha-footer,
.av #gate #av-fa-form altcha-widget .altcha-logo { display: none !important; }
.av #gate #av-fa-form altcha-widget .altcha-error { justify-content: center; margin: 4px 0 0 !important; color: #f08aa3 !important; font-size: 12px !important; }
.av #gate #av-fa-form altcha-widget .altcha-error * { font-size: 12px !important; color: #f08aa3 !important; }

/* back from FormAssembly: brief "confirming" state instead of the form */
.av .gate .gate__wait { display: none; align-items: center; gap: 12px; margin-top: 18px; color: var(--soft); font-size: 15px; }
.av .gate.confirming .gate__wait { display: flex; }
/* back from FormAssembly: "Thank you!" instead of the form's title, no sub-text */
.av .gate .gate__t-done { display: none; }
.av .gate.confirming .gate__t-form,
.av .gate.confirming .gate__lead { display: none; }
.av .gate.confirming .gate__t-done { display: inline; }
.av #gate.confirming #av-fa-form { display: none; }
.av .gate .gate__spin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ffffff2e; border-top-color: var(--arctic); animation: avSpin .8s linear infinite; }
@keyframes avSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .av .gate .gate__spin, .av #gate #av-fa-form[aria-busy=true]::after, .av #gate #av-fa-form .actions.is-busy::after { animation: none; } }
