/* Phase 3 overflow guard — prevent horizontal scroll on narrow viewports.
 * Defensive: catches focus-ring edge push, long email autocomplete overflow,
 * and any inline element that would otherwise force page-wide h-scroll. */
html, body {
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
 * contact.css — 3-phase contact flow (capture → verify → launched)
 * ═══════════════════════════════════════════════════════════════════ */

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0d1520;
  background: #f5f3ee;    /* warm parchment matching ep-index */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Site-aware header ──────────────────────────────────────────── */
.contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.contact-header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.contact-header__brand .ep-logo {
  display: flex;
  align-items: center;
  gap: 4px;
}
.contact-header__brand .ep-cluster {
  transform: scale(0.42);
  transform-origin: left center;
  margin-right: -28px;
}
.contact-header__brand .ep-logo-wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

/* EP brand lockup height constraint — align contact header height with iPS.
 * ep-cluster uses transform:scale(0.42) which doesn't shrink the layout box
 * (natively ~96px). Explicit height on the parent reclaims that space so
 * the header renders at the same ~72px as iPS. */
.contact-header__brand .ep-logo {
  height: 40px;
  overflow: visible;
}
.contact-header__brand .ep-cluster {
  width: 100px;
  height: 40px;
}
/* iPS variant */
.contact-header__brand--ips .di-header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  background: #5b5ff2;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  margin-right: 12px;
}
.contact-header__brand--ips .di-header__wordmark {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}
.contact-header__brand--ips .di-header__eyebrow {
  display: block;
  font-size: 12px;
  color: #8a8f97;
  letter-spacing: 0.02em;
}
.contact-header__right {
  display: flex;
  align-items: center;
}
.contact-header__oracle {
  height: 40px;
  width: auto;
}

/* ── Main content wrapper ───────────────────────────────────────── */
main#contact-root {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 64px;
}
.contact-page {
  width: 100%;
  max-width: 720px;
}

/* ── Hero (capture phase) ───────────────────────────────────────── */
.contact-hero { margin-bottom: 40px; }
.contact-hero__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #c8964a;
  margin: 0 0 16px 0;
}
.contact-hero__headline {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 20px 0;
  color: #0d1520;               /* light-theme default */
}
.contact-hero__lede {
  font-size: 18px;
  line-height: 1.6;
  color: #3a4453;               /* light-theme default */
  margin: 0 0 24px 0;
}
.contact-hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: #5a6472;               /* light-theme default */
}
.contact-hero__trust span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Capture form ───────────────────────────────────────────────── */
.contact-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.contact-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 20px;
  margin-bottom: 24px;
}
.contact-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.contact-field__label {
  font-size: 13px;
  font-weight: 600;
  color: #1a2332;
  display: block;
}
.contact-field__req { color: #c8964a; margin-left: 2px; }
.contact-field__hint { font-weight: 400; font-size: 12px; color: #8a8f97; margin-left: 4px; }
.contact-field input,
.contact-field select {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  height: 44px;                    /* normalize — Safari <select> has extra intrinsic height */
  padding: 0 12px;                 /* switch to horizontal-only padding since height is fixed */
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #0d1520;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-field select {
  /* Keep native OS caret but ensure our height wins */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%236b7684' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 34px;             /* room for the chevron */
}
.contact-field input:focus,
.contact-field select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}
.contact-field input[aria-invalid="true"],
.contact-field select[aria-invalid="true"] { border-color: #d64545; }
.contact-field select:disabled { background: #f5f5f7; color: #5a6472; cursor: not-allowed; }
.contact-field__error {
  font-size: 12px;
  color: #d64545;
  margin-top: 2px;
}

.contact-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #f9f7f2;
  border: 1px solid #ece7de;
  border-radius: 6px;
  font-size: 14px;
  color: #3a4453;
  cursor: pointer;
}
.contact-consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; cursor: pointer; }

.contact-turnstile-slot { margin-bottom: 20px; min-height: 65px; }

.contact-form__errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}
.contact-form__errors ul { margin: 0; padding-left: 20px; font-size: 14px; }

.contact-form__submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.contact-form__routes {
  font-size: 13px;
  color: #6b7684;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.contact-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.contact-btn--primary {
  background: #0066cc;
  color: #ffffff;
}
.contact-btn--primary:hover:not(:disabled) { background: #0052a3; }
.contact-btn--ghost {
  background: #ffffff;
  color: #0066cc;
  border-color: #0066cc;
}
.contact-btn--ghost:hover:not(:disabled) { background: rgba(0, 102, 204, 0.06); }
.contact-btn--link {
  background: transparent;
  color: #6b7684;
  border: none;
  padding: 12px 8px;
  text-decoration: underline;
}
.contact-btn--link:hover:not(:disabled) { color: #0066cc; }
.contact-btn--large {
  padding: 16px 32px;
  font-size: 17px;
}

/* ── Verify phase ───────────────────────────────────────────────── */
.contact-verify {
  background: #ffffff;
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.contact-verify__title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
  color: #0d1520;
}
.contact-verify__lede {
  font-size: 16px;
  color: #3a4453;
  margin: 0 0 8px 0;
}
.contact-verify__ttl {
  font-size: 14px;
  color: #6b7684;
  margin: 0 0 32px 0;
}
.contact-code {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.contact-code__digit {
  width: 48px; height: 60px;
  font-family: 'JetBrains Mono', Menlo, Monaco, monospace;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #0d1520;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-code__digit:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}
.contact-verify__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Launched (success) phase ───────────────────────────────────── */
.contact-launched {
  background: #ffffff;
  border-radius: 12px;
  padding: 64px 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.contact-launched__check {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 40px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.contact-launched__title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
  color: #0d1520;
}
.contact-launched__lede {
  font-size: 17px;
  color: #3a4453;
  margin: 0 0 32px 0;
}

/* ── Footer (shared with ep-index) ──────────────────────────────── */
.epi-footer {
  background: #0d1520;
  color: #a0a8b4;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.epi-footer__col { }
.epi-footer__left   { text-align: left;   }
.epi-footer__center { text-align: center; }
.epi-footer__right  { text-align: right;  }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .contact-header { padding: 12px 16px; }
  .contact-header__oracle { height: 32px; }
  main#contact-root { padding: 24px 16px 40px; }
  .contact-hero__headline { font-size: 28px; }
  .contact-hero__lede { font-size: 15px; }
  .contact-form { padding: 20px; }
  .contact-form__grid { grid-template-columns: 1fr; gap: 16px; }
  .contact-verify { padding: 32px 20px; }
  .contact-verify__title { font-size: 26px; }
  .contact-code__digit { width: 40px; height: 52px; font-size: 24px; }
  .contact-launched { padding: 40px 20px; }
  .contact-launched__title { font-size: 28px; }
  .epi-footer {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 16px;
  }
  .epi-footer__left, .epi-footer__center, .epi-footer__right { text-align: center; }
}


/* ── Header logo: force dark wordmark on white header ────────────── */
.contact-header .ep-logo-wordmark { color: #1a2733 !important; }


/* ── Email typo suggestion ("Did you mean X?") ─────────────────── */
.contact-field__suggestion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  background: #FFF3C4;
  border-radius: 6px;
  font-size: 13px;
  color: #856404;
  animation: contact-fade-up 200ms ease-out both;
}
.contact-field__suggestion-link {
  padding: 0;
  border: none;
  background: none;
  color: #856404;
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.contact-field__suggestion-link:hover { color: #6B4E00; }
.contact-field__suggestion-link:focus-visible {
  outline: 2px solid #856404;
  outline-offset: 2px;
  border-radius: 2px;
}
.contact-field__hint {
  font-weight: 400;
  font-size: 12px;
  color: #8a8f97;
  margin-left: 4px;
}
@keyframes contact-fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Theme-aware hero text ─────────────────────────────────────────── */
/* Default above uses dark text (light theme).
   Dark mode (system pref OR explicit) flips to light text.             */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contact-hero__headline { color: #ffffff; }
  :root:not([data-theme="light"]) .contact-hero__lede     { color: #dde3ec; }
  :root:not([data-theme="light"]) .contact-hero__trust    { color: #b8bcc4; }
}
:root[data-theme="dark"] .contact-hero__headline { color: #ffffff; }
:root[data-theme="dark"] .contact-hero__lede     { color: #dde3ec; }
:root[data-theme="dark"] .contact-hero__trust    { color: #b8bcc4; }

/* Dark theme: swap hero text to light */
