/* Self-hosted fonts (no third-party requests from inside the widget) */
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --primary: #171745;        /* navy: buttons, progress */
  --primary-hover: #0e0e30;
  --accent: #1F5C5A;         /* teal: icons, focus, selected */
  --accent-soft: #EAF2F0;
  --ink: #1B2A2F;
  --ink-2: #4E5A5E;
  --muted: #5A6468;
  --ground: #F6F4EF;
  --line: #E4DFD5;
  --field-line: #D5CFC4;
  --track: #DDD8CE;
  --error: #A3261B;
  --error-soft: #FBEDEB;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.widget {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}

/* Header */
.widget__header {
  padding: 32px 40px 22px;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.eyebrow {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.title {
  margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; color: var(--primary);
}
.subtitle { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

.progress { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.progress__bar { display: flex; gap: 6px; }
.progress__seg { flex: 1; height: 6px; border-radius: 3px; background: var(--track); transition: background .2s; }
.progress__seg.is-on { background: var(--primary); }
.progress__meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.progress__label { font-weight: 600; color: var(--ink); }

/* Body */
.widget__body { display: flex; flex-direction: column; }
.step { padding: 26px 40px 8px; display: flex; flex-direction: column; gap: 18px; }
.step__title { margin: 0; font-size: 20px; font-weight: 600; outline: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select {
  width: 100%; height: 48px; padding: 0 14px;
  font: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--field-line); border-radius: 12px;
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234E5A5E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input[type="date"] { min-height: 48px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.is-invalid { border-color: var(--error) !important; }
.field-error { margin: 0; font-size: 13px; color: var(--error); }

.consent { margin: 0; padding: 14px 16px; background: var(--ground); border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

.alert {
  margin: 20px 40px 0; padding: 12px 16px; border-radius: 12px;
  background: var(--error-soft); color: var(--error); font-size: 14px; font-weight: 500; line-height: 1.45;
}

/* Footer / buttons */
.widget__footer { margin-top: 18px; padding: 18px 40px 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: var(--radius);
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 0;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }
.btn--ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--field-line); }
.btn--grow { flex: 1; }
.btn--block { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .7; cursor: progress; }

.spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
.is-loading .icon-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.secure { margin: 0; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-align: center; }

/* Result */
.result { padding-bottom: 28px; gap: 20px; }
.result__head { display: flex; align-items: center; gap: 16px; }
.result__icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.result__icon.is-neutral { background: #F1EEE8; color: var(--ink-2); }
.result__title { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 26px; font-weight: 600; color: var(--primary); outline: none; }
.result__text { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.callout { padding: 16px 20px; border: 1px solid var(--line); border-radius: 16px; background: #FBFAF7; }
.callout h3 { margin: 0 0 6px; font-size: 16px; }
.callout p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }

/* Mobile */
@media (max-width: 480px) {
  .widget { border-radius: 20px; }
  .widget__header { padding: 24px 20px 20px; }
  .title { font-size: 26px; line-height: 1.2; }
  .step { padding: 22px 20px 4px; }
  .alert { margin: 16px 20px 0; }
  .widget__footer { padding: 16px 20px 20px; }
  .grid-2--stack-mobile { grid-template-columns: 1fr; gap: 18px; }
  .secure { font-size: 12px; line-height: 1.4; }
  .result__title { font-size: 22px; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 480px) {
  .result__head { align-items: flex-start; }
  .btn--block { padding: 10px 18px; text-align: center; }
}

/* ---------- Searchable provider combobox ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.combo__control { position: relative; }
.combo__input { padding-right: 72px; }
.combo__chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.combo__clear {
  position: absolute; right: 36px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.combo__clear:hover { background: var(--ground); color: var(--ink); }
.combo__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  margin: 0; padding: 6px; list-style: none;
  max-height: 272px; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1.5px solid var(--field-line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(27, 42, 47, .14);
}
.combo__opt {
  display: flex; align-items: center; min-height: 44px; padding: 10px 12px;
  border-radius: 8px; font-size: 15px; line-height: 1.3; cursor: pointer; color: var(--ink);
}
.combo__opt mark { background: transparent; color: inherit; font-weight: 700; }
.combo__opt[aria-selected="true"], .combo__opt:hover { background: var(--accent-soft); }
.combo__opt.is-active { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.combo__opt--other { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; border-radius: 0 0 8px 8px; color: var(--accent); font-weight: 600; }
.combo__empty { padding: 12px; font-size: 14px; color: var(--muted); }
.combo.is-selected .combo__input { font-weight: 600; }

/* Grouped location select: optgroup labels are native; this just keeps them readable */
select optgroup { font-weight: 700; color: var(--ink-2); }
select option { color: var(--ink); font-weight: 400; }

/* ---------- Responsive polish ---------- */
.widget { width: 100%; }
@media (max-width: 480px) {
  .combo__list { max-height: 240px; }
  .combo__opt { min-height: 48px; }
  input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select { height: 50px; }
  .btn { min-height: 52px; }
  .actions { flex-direction: row; }
  .actions .btn--ghost { min-width: 84px; }
}
@media (max-width: 360px) {
  .grid-2 { grid-template-columns: 1fr; }
  .title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .progress__seg, .spinner { transition: none; animation: none; }
}

/* Spam honeypot: kept in the layout for bots, invisible to people */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Long placeholders end in "…" instead of running under the clear/arrow buttons */
.combo__input { text-overflow: ellipsis; }
.combo__input::placeholder { text-overflow: ellipsis; }
