/* LiveWise Insurance Services — Pre-Call Intake
   Mobile-first, senior-friendly: 18px+ type, 56px+ targets, high contrast. */

:root {
  --navy:        #0A1E3C;
  --navy-deep:   #061529;
  --navy-card:   #122A50;
  --navy-line:   #2A4570;
  --gold:        #D4AF37;
  --gold-bright: #EAC85E;
  --white:       #FFFFFF;
  --muted:       #C9D6E8;
  --muted-dim:   #93A7C4;
  --danger:      #FF9A8B;
  --radius:      14px;
  --tap:         60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Must beat the display:flex/block rules below, or [hidden] panels show anyway. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.skip-to {
  position: absolute; left: -9999px;
}
.skip-to:focus {
  left: 12px; top: 12px; z-index: 50;
  background: var(--gold); color: var(--navy-deep);
  padding: 12px 18px; border-radius: 8px; font-weight: 700;
}

.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */

.top {
  padding: calc(22px + env(safe-area-inset-top)) 0 18px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: block; width: 63px; height: 48px; flex: 0 0 auto; }
.wordmark { display: flex; flex-direction: column; gap: 2px; }
.wm-name {
  font-size: 24px; font-weight: 800; letter-spacing: 0.16em;
  color: var(--white);
}
.wm-sub {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
}

.steps { margin-top: 20px; }
.steps-label {
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted-dim); margin-bottom: 8px;
}
.bar {
  height: 7px; border-radius: 99px;
  background: rgba(255,255,255,0.13); overflow: hidden;
}
.bar-fill {
  height: 100%; width: 25%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.35s ease;
}

/* ---------- screens ---------- */

main { flex: 1 0 auto; }

.screen { display: none; padding-bottom: 8px; }
.screen.is-active { display: block; animation: rise 0.28s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen.is-active { animation: none; }
  .bar-fill { transition: none; }
}

h1 {
  font-size: 30px; line-height: 1.2; font-weight: 800;
  margin: 6px 0 14px; letter-spacing: -0.015em;
}
.dot { color: var(--gold); }

h2 { font-size: 19px; font-weight: 700; margin: 0; }

.lede { font-size: 18.5px; color: var(--muted); margin: 0 0 22px; }
.lede strong { color: var(--white); }
.lede.small { font-size: 16.5px; margin-top: 20px; }

.hello {
  font-size: 20px; font-weight: 700; color: var(--gold-bright);
  margin: 0 0 10px;
}

.ticks {
  list-style: none; margin: 0 0 28px; padding: 0;
  border-top: 1px solid var(--navy-line);
}
.ticks li {
  padding: 15px 0 15px 34px;
  border-bottom: 1px solid var(--navy-line);
  font-size: 18px; position: relative;
}
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 21px;
  width: 9px; height: 16px;
  border-right: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  transform: rotate(45deg);
}

.note {
  background: rgba(212,175,55,0.10);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px; margin: 0 0 20px;
  font-size: 17px; color: var(--white);
}

/* ---------- fields ---------- */

.field { margin: 0 0 18px; }
.field-row { display: flex; gap: 12px; }
.field-row .grow { flex: 1 1 auto; }
.field-row .shrink { flex: 0 0 108px; }

label, legend {
  display: block; font-size: 16.5px; font-weight: 700;
  color: var(--white); margin-bottom: 8px;
}
.opt { font-weight: 500; color: var(--muted-dim); }

input[type="text"], input[type="tel"], select {
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 19px;
  color: var(--navy-deep);
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius);
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7l5 6 5-6z' fill='%230A1E3C'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 22px;
  padding-right: 42px;
}
input::placeholder { color: #7B8CA3; }

input:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ---------- buttons ---------- */

.btn {
  display: block; width: 100%;
  min-height: var(--tap);
  margin: 24px 0 0;
  padding: 16px 20px;
  font-family: var(--font);
  font-size: 20px; font-weight: 800; letter-spacing: 0.01em;
  color: var(--navy-deep);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: none; border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 0 #A8871F;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #A8871F; }
.btn[disabled] { opacity: 0.5; box-shadow: none; cursor: default; }
.btn.btn-sm { font-size: 17.5px; min-height: 54px; margin-top: 6px; }

.skip {
  display: block; width: 100%;
  min-height: 52px; margin: 14px 0 0; padding: 12px;
  background: none; border: none;
  font-family: var(--font); font-size: 16.5px;
  color: var(--muted-dim);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.skip:active { color: var(--white); }

.linkish {
  display: inline-block;
  min-height: 48px; padding: 12px 0;
  background: none; border: none;
  font-family: var(--font); font-size: 16.5px; font-weight: 600;
  color: var(--gold-bright);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; text-align: left;
}
.linkish.center { display: block; width: 100%; text-align: center; }

/* ---------- chips (selected items) ---------- */

.chips { display: flex; flex-direction: column; gap: 10px; }
.chips:not(:empty) { margin-bottom: 22px; }

.chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 13px 8px 13px 15px;
}
.chip-body { flex: 1 1 auto; min-width: 0; }
.chip-title { font-size: 17.5px; font-weight: 700; }
.chip-meta { font-size: 15px; color: var(--muted-dim); margin-top: 2px; }
.chip-x {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  background: none; border: none;
  color: var(--muted); font-size: 26px; line-height: 1;
  cursor: pointer; border-radius: 8px;
}
.chip-x:active { background: rgba(255,255,255,0.1); color: var(--white); }

/* ---------- search results ---------- */

.status { font-size: 16px; color: var(--muted-dim); min-height: 26px; }
.status.warn { color: var(--gold-bright); }

.spinner {
  display: inline-block; vertical-align: -3px;
  width: 17px; height: 17px; margin-right: 9px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.big { width: 40px; height: 40px; border-width: 4px; margin: 0 auto 16px; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.results { display: flex; flex-direction: column; gap: 10px; }
.results:not(:empty) { margin: 10px 0 4px; }

.hit {
  display: block; width: 100%; text-align: left;
  min-height: var(--tap);
  padding: 15px 16px;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  color: var(--navy-deep);
  cursor: pointer;
}
.hit:active { border-color: var(--gold); background: #FFF9E8; }
.hit-title { font-size: 18px; font-weight: 700; }
.hit-spec { font-size: 15.5px; color: #3F5A7D; margin-top: 3px; }
.hit-addr { font-size: 15px; color: #63768F; margin-top: 3px; }
.hit-added { font-size: 15px; font-weight: 700; color: #0F7A3D; margin-top: 4px; }

.manual {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 16px 16px 20px; margin: 4px 0 8px;
}
.manual .field:last-of-type { margin-bottom: 12px; }

/* ---------- medication detail ---------- */

.picked {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 13px 16px; margin-bottom: 22px;
}
.picked-label {
  display: block; font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 3px;
}
.picked strong { font-size: 19px; }

.freq { border: none; margin: 0 0 4px; padding: 0; }
.freq legend { padding: 0; }
.freq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pill {
  min-height: 56px; padding: 12px 10px;
  background: transparent;
  border: 2px solid var(--navy-line);
  border-radius: 10px;
  font-family: var(--font); font-size: 16.5px; font-weight: 600;
  color: var(--white); cursor: pointer;
}
.pill[aria-pressed="true"] {
  background: var(--gold); border-color: var(--gold);
  color: var(--navy-deep); font-weight: 800;
}

/* ---------- review ---------- */

.card {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.card-head .linkish { min-height: 40px; padding: 8px 0; font-size: 16px; flex: 0 0 auto; }

.review-list { list-style: none; margin: 0; padding: 0; }
.review-list li {
  padding: 11px 0;
  border-top: 1px solid var(--navy-line);
  font-size: 17.5px;
}
.review-list li:first-child { border-top: none; }
.review-list li span { display: block; font-size: 15px; color: var(--muted-dim); }
.review-list li.none { color: var(--muted-dim); font-style: italic; }

.consent {
  font-size: 16px; color: var(--muted);
  background: rgba(255,255,255,0.05);
  border-radius: 10px; padding: 14px 16px;
  margin: 24px 0 0;
}

.err {
  font-size: 17px; font-weight: 600; color: var(--danger);
  background: rgba(255,80,60,0.12);
  border-radius: 10px; padding: 13px 15px; margin: 18px 0 0;
}

/* ---------- done ---------- */

.tick-big { margin: 12px 0 18px; }
.done-sum {
  font-size: 17px; color: var(--muted);
  background: rgba(255,255,255,0.05);
  border-radius: 10px; padding: 14px 16px; margin: 0 0 4px;
  white-space: pre-line;
}

/* ---------- footer ---------- */

.bottom {
  flex: 0 0 auto;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--navy-line);
  text-align: center;
}
.bottom p { margin: 0; font-size: 16px; color: var(--muted-dim); }
.tel {
  display: inline-block; margin: 8px 0 14px;
  font-size: 25px; font-weight: 800; letter-spacing: 0.01em;
  color: var(--gold-bright); text-decoration: none;
  padding: 8px 4px;
}
.legal { font-size: 13.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- overlays ---------- */

.sheet-wrap, .veil {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(4,12,24,0.78);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 20px;
}
.veil {
  align-items: center; flex-direction: column; justify-content: center;
  color: var(--muted);
}
.veil p { margin: 0; font-size: 18px; }

.sheet {
  width: 100%; max-width: 520px;
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: 18px;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
}
.sheet h2 { font-size: 23px; margin-bottom: 10px; }
.sheet p { font-size: 17.5px; color: var(--muted); margin: 0; }

@media (min-width: 600px) {
  .sheet-wrap { align-items: center; }
}
