:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #153b37;
  background: #e8efec;
  font-synthesis: none;
  --ink: #153b37;
  --muted: #667b77;
  --line: #d5e0dc;
  --surface: #ffffff;
  --wash: #f4f7f5;
  --primary: #009d63;
  --primary-dark: #00774c;
  --navy: #032f43;
  --accent: #d7f0e7;
  --danger: #a33a4a;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #e8efec; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #f9fbfa 0, #edf3f0 42%, #e4ece9 100%); }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.app-frame {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--wash);
  box-shadow: 0 0 54px rgba(7, 63, 59, .1);
}

.app-header {
  min-height: 78px;
  padding: max(16px, env(safe-area-inset-top)) 20px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  object-fit: cover;
  background: #021822;
  box-shadow: 0 6px 16px rgba(3, 47, 67, .2);
}
.careform-brand { display: flex; flex-direction: column; }
.app-header strong { font-size: 16px; letter-spacing: -.01em; }
.app-header span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.app-header .powered-by { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: #41616b; font-size: 8px; font-weight: 750; letter-spacing: .03em; }
.powered-by img { width: 14px; height: 14px; object-fit: cover; border-radius: 4px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-link { border: 0; background: transparent; color: var(--primary-dark); font-weight: 750; padding: 10px 0 10px 12px; }

.screen { padding: 30px 20px max(34px, env(safe-area-inset-bottom)); }
.welcome-screen { min-height: calc(100vh - 78px); display: flex; flex-direction: column; }
.welcome-art {
  margin: 14px 0 22px;
  width: 112px;
  height: 112px;
  border-radius: 32px;
  object-fit: cover;
  background: #021822;
  box-shadow: 0 20px 42px rgba(3, 47, 67, .24);
}
.eyebrow { margin: 0 0 10px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .15em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; color: var(--navy); font-weight: 600; font-size: clamp(34px, 9vw, 48px); line-height: 1.03; letter-spacing: -.035em; }
.lead { color: #58716c; font-size: 16px; line-height: 1.65; margin: 18px 0 24px; }
.trust-list { border-top: 1px solid var(--line); margin-bottom: 24px; }
.trust-list > div { display: grid; grid-template-columns: 42px 1fr; gap: 4px; align-items: start; padding: 15px 0; border-bottom: 1px solid var(--line); }
.trust-list > div > span { padding-top: 2px; font-size: 11px; font-weight: 850; color: var(--primary); }
.trust-list p { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.trust-list strong { font-size: 14px; }
.trust-list small { color: var(--muted); line-height: 1.45; }

.primary-button, .secondary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-weight: 820;
  cursor: pointer;
}
.primary-button { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 12px 26px rgba(7, 94, 84, .2); }
.primary-button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.secondary-button { color: var(--primary-dark); background: #e1efea; }
.fine-print { color: #7e8e8b; text-align: center; font-size: 11px; line-height: 1.5; margin: 16px 12px 0; }

.flow-screen { padding-top: 18px; }
.flow-heading { display: grid; grid-template-columns: 38px 1fr 42px; align-items: center; gap: 9px; }
.flow-heading h1 { font-family: inherit; font-size: 23px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.flow-heading p { margin: 0 0 4px; color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.flow-heading > span { justify-self: end; color: var(--muted); font-weight: 750; font-size: 12px; }
.back-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 20px; }
.progress { height: 4px; margin: 18px 0 20px; border-radius: 999px; overflow: hidden; background: #dce6e2; }
.progress span { display: block; height: 100%; width: 20%; background: var(--primary); border-radius: inherit; transition: width .24s ease; }

.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: 0 14px 34px rgba(7, 63, 59, .06); }
.section-copy { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; }
label { display: block; margin: 0 0 16px; }
label > span:first-child:not(.check-row span) { display: block; margin: 0 0 7px; color: #294b46; font-size: 12px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid #bdcec8;
  border-radius: 13px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8, 124, 109, .12); background: white; }
textarea { resize: vertical; min-height: 112px; line-height: 1.45; }
.two-fields { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.two-fields.names { grid-template-columns: 1fr 1fr; }
.status-copy { margin: 12px 0 0; min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.status-copy.error { color: var(--danger); }

.provider-results, .choice-list { display: grid; gap: 10px; margin: 18px 0; }
.provider-card, .choice-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  background: white;
  color: var(--ink);
}
.provider-card.selected, .choice-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(8, 124, 109, .12); background: #f4fbf8; }
.provider-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--accent); color: var(--primary-dark); font-weight: 850; }
.provider-card div, .choice-card div { display: flex; flex-direction: column; gap: 3px; }
.provider-card strong, .choice-card strong { font-size: 14px; }
.provider-card small, .choice-card small { color: var(--muted); }
.radio-dot { width: 20px; height: 20px; border: 2px solid #aabdb6; border-radius: 50%; }
.selected .radio-dot { border: 6px solid var(--primary); }

.selected-provider { padding: 14px; margin: 0 0 18px; border-radius: 14px; background: #edf7f3; border: 1px solid #d4e9e1; }
.selected-provider span { display: block; color: var(--primary); font-size: 10px; letter-spacing: .11em; font-weight: 850; margin-bottom: 4px; }
.selected-provider strong { font-size: 14px; }
.selected-provider small { display: block; color: var(--muted); margin-top: 4px; }
.privacy-callout { display: grid; grid-template-columns: 38px 1fr; gap: 8px; padding: 15px; margin-bottom: 18px; background: #edf7f3; border-radius: 15px; }
.privacy-callout > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: white; }
.privacy-callout p { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.privacy-callout small { color: var(--muted); line-height: 1.45; }
.check-row { display: grid; grid-template-columns: 23px 1fr; gap: 10px; align-items: start; margin: 18px 0; color: #47635e; font-size: 13px; line-height: 1.45; }
.check-row input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--primary); }

.questions { display: grid; gap: 20px; }
.question-group { padding-bottom: 4px; }
.question-group h2 { margin: 2px 0 17px; color: var(--navy); font-size: 17px; }
.question[hidden] { display: none; }
.question label { margin-bottom: 7px; color: #294b46; font-size: 13px; font-weight: 780; line-height: 1.35; }
.optional { margin-left: 6px; color: #889793; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.multi-select { display: grid; gap: 8px; }
.multi-option {
  min-height: 48px;
  margin: 0 !important;
  padding: 11px 12px;
  display: grid !important;
  grid-template-columns: 23px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid #bdcec8;
  border-radius: 13px;
  background: #fbfcfc;
  color: var(--ink) !important;
  font-weight: 650 !important;
  cursor: pointer;
}
.multi-option:has(input:checked) { border-color: var(--primary); background: #edf7f3; box-shadow: 0 0 0 2px rgba(8, 124, 109, .09); }
.multi-option input { width: 22px; min-height: 22px; margin: 0; padding: 0; accent-color: var(--primary); }
.urgent-notice { margin-top: 10px; padding: 14px; border: 1px solid #c54d5d; border-radius: 14px; background: #fff1f2; color: #762735; }
.urgent-notice strong { display: block; font-size: 14px; }
.urgent-notice p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.section-nav { margin: 21px 0 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.section-nav .secondary-button { min-height: 44px; padding: 10px 12px; border-radius: 13px; }
.section-nav .secondary-button:last-child { grid-column: 3; }
.section-nav span { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.review-box { padding: 14px; margin: 18px 0; border: 1px solid #e2ded0; border-radius: 14px; background: #fffdf5; }
.review-box p { margin: 5px 0 0; color: #786f58; font-size: 12px; line-height: 1.45; }
.governance-notice { border-color: #d38b38; background: #fff3df; color: #713f0f; }
.governance-notice strong { display: block; font-size: 13px; }
.governance-notice p { color: #713f0f; }

.review-content { display: grid; gap: 15px; }
.review-section { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.review-section h2 { margin: 0; padding: 12px 14px; background: #f0f5f3; color: var(--navy); font-size: 13px; }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 11px 14px; border-top: 1px solid #e7eeeb; font-size: 12px; }
.review-row span { color: var(--muted); }
.review-row strong { text-align: right; overflow-wrap: anywhere; }

.receipt-screen { min-height: calc(100vh - 78px); text-align: center; }
.receipt-check { width: 74px; height: 74px; display: grid; place-items: center; margin: 12px auto 20px; border-radius: 50%; background: var(--primary); color: white; font-size: 37px; box-shadow: 0 18px 38px rgba(8, 124, 109, .25); }
.receipt-screen h1 { font-size: clamp(31px, 8vw, 44px); }
.receipt-screen > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.reference-card { margin: 24px 0 16px; padding: 21px 12px; border: 1px solid #bfd4cc; border-radius: 19px; background: white; box-shadow: 0 14px 30px rgba(7, 63, 59, .06); }
.reference-card span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .14em; font-weight: 850; }
.reference-card strong { display: block; margin: 9px 0; color: var(--navy); font-size: clamp(23px, 7vw, 34px); letter-spacing: .055em; overflow-wrap: anywhere; }
.reference-card small { color: var(--muted); }
.receipt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.next-steps { margin: 24px 0 18px; padding: 19px; text-align: left; border-radius: 18px; background: #e9f3ef; }
.next-steps h2 { margin: 0 0 12px; font-size: 16px; }
.next-steps ol { margin: 0; padding-left: 22px; color: #4e6964; font-size: 13px; line-height: 1.55; }
.next-steps li + li { margin-top: 8px; }
.text-button { border: 0; background: transparent; color: var(--primary-dark); font-weight: 800; padding: 12px; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; background: rgba(4, 35, 33, .48); backdrop-filter: blur(4px); }
.sheet { width: min(100%, 760px); margin: 0 auto; padding: 10px 22px max(28px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: white; box-shadow: 0 -25px 70px rgba(2, 30, 28, .2); }
.sheet-handle { width: 42px; height: 4px; margin: 2px auto 17px; border-radius: 999px; background: #cdd8d4; }
.sheet header { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { margin: 0; font-size: 20px; }
.sheet header button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf3f0; font-size: 22px; }
.sheet p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.privacy-route { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 14px 10px; margin: 16px 0; border-radius: 14px; background: #edf7f3; color: var(--primary-dark); font-size: 10px; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 150; transform: translateX(-50%); width: min(calc(100% - 32px), 480px); padding: 13px 16px; border-radius: 13px; background: #103f3b; color: white; text-align: center; font-size: 13px; box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.toast.error { background: #8b3242; }

@media (min-width: 640px) {
  .screen { padding-left: 44px; padding-right: 44px; }
  .welcome-screen { padding-top: 48px; }
  .step-card { padding: 30px; }
  .welcome-art { width: 112px; height: 112px; }
}

@media (max-width: 390px) {
  .screen { padding-left: 15px; padding-right: 15px; }
  .two-fields, .two-fields.names { grid-template-columns: 1fr; gap: 0; }
  .reference-card strong { font-size: 21px; }
  .section-nav { grid-template-columns: 1fr 1fr; }
  .section-nav span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .section-nav .secondary-button { grid-row: 2; }
  .section-nav .secondary-button:last-child { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
