:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #067647;
  --accent-hover: #055e38;
  --accent-soft: #ecfdf3;
  --danger: #b42318;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Layout: one centered column (headline, short intro, form) --- */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding-top: 72px;
  padding-bottom: 96px;
}

@media (max-width: 700px) {
  .page { gap: 28px; padding-top: 44px; padding-bottom: 64px; }
}

/* --- Hero --- */
.hero {
  max-width: 720px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.3rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}

.hero h1 .accent { color: var(--accent); }

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 52ch;
  margin: 0 auto;
}

/* --- Card --- */
.card {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.card-head {
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.card-head p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* --- Form --- */
@media (max-width: 700px) {
  .card { padding: 20px 16px; }
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 440px) {
  .row { grid-template-columns: 1fr; }
}

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: #98a2b3; }

.field select { appearance: auto; }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.12);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 5px 0 0;
  min-height: 1em;
  color: var(--danger);
  font-size: 0.8rem;
}

/* --- Interests dropdown --- */
.int-dd { position: relative; }

.int-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.int-btn:hover { border-color: #98a2b3; }

.int-btn:focus,
.int-btn[aria-expanded="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.12);
}

.int-btn .chev { flex: 0 0 auto; width: 12px; height: 12px; color: #98a2b3; transition: transform 0.15s; }

.int-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.int-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #98a2b3;
}

.int-btn.has-value .int-value { color: var(--ink); }

.int-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: 100%;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
}

.int-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.int-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.int-list li:hover { background: var(--bg); }

.int-list li .tick {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--accent);
  visibility: hidden;
}

.int-list li[aria-selected="true"] {
  color: var(--ink);
  font-weight: 550;
  background: var(--accent-soft);
}

.int-list li[aria-selected="true"] .tick { visibility: visible; }
.int-list li[aria-selected="true"]:hover { background: var(--accent-soft); }

/* --- Country dropdown (same panel as the phone flags) --- */
.country-dd { position: relative; }

.country-panel { width: 100%; }

#otherInterest {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

#otherInterest:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.12);
}

/* --- Phone: flag dropdown + number --- */
.phone-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.phone-group #phone { flex: 1; min-width: 0; }

.flag-dd { position: relative; flex: 0 0 auto; }

.flag-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 84px;
  padding: 10px 11px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.flag-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #98a2b3;
}

.flag-btn:hover { border-color: #98a2b3; }

.flag-btn:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.12);
}

.flag-emoji { font-size: 1.05rem; line-height: 1; }
.flag-dial { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.flag-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  /* Fits small phones: never wider than the viewport minus page padding. */
  width: min(290px, calc(100vw - 48px));
  max-height: 300px;
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
}

.flag-panel input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.flag-panel input:focus {
  outline: none;
  border-color: var(--accent);
}

.flag-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flag-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.9rem;
}

.flag-list li:hover,
.flag-list li.active { background: var(--bg); }

.flag-list .fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag-list .fd { color: var(--muted); font-variant-numeric: tabular-nums; }
.flag-list .empty { color: var(--muted); cursor: default; }

/* honeypot: visually and structurally hidden */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent { margin-top: 4px; }

.consent .checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
}

.consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.consent a { color: var(--accent); }

/* --- Buttons --- */
.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.form-message {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--danger);
  min-height: 1.2em;
}

/* --- Success / paused states --- */
.success,
.paused { text-align: center; padding: 28px 8px 16px; }

.state-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.paused .state-icon {
  background: #f2f4f7;
  color: var(--ink-2);
}

.success h2,
.paused h2 { margin: 0 0 6px; font-size: 1.2rem; font-weight: 650; }

.success p,
.paused p { color: var(--muted); margin: 0; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 44px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer p { max-width: 720px; margin: 5px auto; }
.footer-brand { font-weight: 550; color: var(--ink-2); }

.cf-turnstile { margin: 4px 0 16px; }

/* --- Phones: comfortable tap targets, no focus-zoom, tighter gutters --- */
html { -webkit-text-size-adjust: 100%; }

button, label.checkbox, .int-list li, .flag-list li {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (max-width: 700px) {
  .container { padding: 0 16px; }
  .hero h1 { margin-bottom: 14px; }
  .lead { font-size: 1rem; }

  .card { padding: 22px 16px; border-radius: 14px; }
  .card-head { padding-bottom: 16px; margin-bottom: 18px; }

  .field { margin-bottom: 14px; }
  .field label { font-size: 0.9rem; margin-bottom: 7px; }

  /* 16px text keeps iOS Safari from zooming the page when a field gets focus;
     50px rows are easy to hit with a thumb. */
  .field input:not([type="checkbox"]),
  .int-btn,
  .flag-btn {
    font-size: 16px;
    min-height: 50px;
  }

  .int-list li,
  .flag-list li { padding: 13px 10px; font-size: 1rem; }
  .int-panel,
  .flag-panel { max-height: 46vh; }

  .field-error { font-size: 0.84rem; }

  .consent .checkbox { gap: 12px; font-size: 0.9rem; }
  .consent input[type="checkbox"] { width: 22px; height: 22px; margin-top: 1px; }

  .btn-primary { min-height: 54px; font-size: 1.05rem; border-radius: 10px; }

  .footer { padding: 24px 16px 36px; }
}

/* The verification widget is at least 300px wide — shrink it on very narrow phones. */
@media (max-width: 363px) {
  .cf-turnstile { transform: scale(0.86); transform-origin: left top; margin-bottom: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
