/* Insurance notebook — system fonts only, no scripts, no external assets (CSP default-src 'none'). */

:root {
  color-scheme: light;
  --paper: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #eaeef0;
  --ink: #15222b;
  --ink-2: #4f5f6a;
  --line: #d3dbe0;
  --line-2: #aebac2;
  --brand: #0b5e6b;
  --brand-ink: #ffffff;
  --brand-soft: #e2f0f2;
  --brand-line: #8fc3cb;
  --ok: #1e6f47;
  --ok-soft: #e6f4ec;
  --warn: #8a5300;
  --warn-soft: #fff3dc;
  --err: #b3261e;
  --err-soft: #fdecea;
  --shadow: 0 1px 2px rgba(21, 34, 43, 0.06), 0 10px 28px -14px rgba(21, 34, 43, 0.22);
  --radius: 12px;
  --radius-s: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0e1619;
    --surface: #172227;
    --surface-2: #1f2c33;
    --ink: #e6edf0;
    --ink-2: #a3b2ba;
    --line: #2b3a42;
    --line-2: #40525c;
    --brand: #79cbd6;
    --brand-ink: #0e1619;
    --brand-soft: #123239;
    --brand-line: #2f6a74;
    --ok: #8fd4ad;
    --ok-soft: #12312a;
    --warn: #f2c078;
    --warn-soft: #3a2a0f;
    --err: #ff9f97;
    --err-soft: #3d1a18;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 650;
}

small,
.hint,
.meta {
  font-size: 0.875rem;
  color: var(--ink-2);
}

a,
button,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 20;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-s);
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.wrap--wide {
  max-width: 1080px;
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 0;
}

.signout-form {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tabs li {
  flex: 1 1 0;
  min-width: 0;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 6px;
  color: var(--ink-2);
  font-weight: 550;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  text-align: center;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-current="page"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

@media (min-width: 640px) {
  .header-row {
    min-height: 64px;
  }

  .site-header nav {
    margin-top: -64px;
    padding-left: 230px;
    padding-right: 120px;
  }

  .tabs li {
    flex: 0 0 auto;
  }

  .tab {
    padding: 8px 14px;
    min-height: 64px;
  }
}

/* ---------- page furniture ---------- */

main {
  padding-top: 28px;
  padding-bottom: 72px;
}

.site-footer {
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.875rem;
}

.page-title {
  font-family: var(--serif);
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 12px;
}

@media (min-width: 720px) {
  .page-title {
    font-size: 2.375rem;
  }
}

.lede {
  font-size: 1.0625rem;
  color: var(--ink-2);
  max-width: 62ch;
  margin-bottom: 20px;
}

.step-count,
.crumb {
  font-size: 0.875rem;
  color: var(--ink-2);
  margin: 0 0 6px;
}

.crumb a {
  color: inherit;
}

.section {
  margin: 32px 0;
}

.section > h2 {
  margin-bottom: 8px;
}

.section > h2 + p {
  color: var(--ink-2);
}

/* ---------- notices ---------- */

.notice {
  margin: 0 0 20px;
  padding: 14px 16px 14px 18px;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-s);
  background: var(--brand-soft);
  color: var(--ink);
}

.notice ul {
  margin: 6px 0 0;
}

.notice--ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.notice--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.notice--err {
  border-left-color: var(--err);
  background: var(--err-soft);
}

.notice--err a {
  color: var(--err);
  font-weight: 600;
}

.notice--quiet {
  background: var(--surface-2);
  border-left-color: var(--line-2);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* ---------- cards & chips ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.card__head h2,
.card__head h3 {
  flex: 1 1 200px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 550;
  line-height: 1.3;
}

.chip--brand {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
}

.chip--ok {
  border-color: transparent;
  background: var(--ok-soft);
  color: var(--ok);
}

.chip--warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}

.chip--err {
  border-color: transparent;
  background: var(--err-soft);
  color: var(--err);
}

/* ---------- facts (definition lists) ---------- */

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 20px;
  margin: 0 0 12px;
}

.facts dt {
  color: var(--ink-2);
  font-size: 0.875rem;
  padding-top: 8px;
}

.facts dd {
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 600px) {
  .facts {
    grid-template-columns: minmax(150px, 32%) minmax(0, 1fr);
    gap: 0 20px;
  }

  .facts dt,
  .facts dd {
    padding: 7px 0;
    border-top: 1px solid var(--line);
    margin: 0;
  }

  .facts dt:first-of-type,
  .facts dd:first-of-type {
    border-top: 0;
  }
}

/* ---------- forms ---------- */

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

.group {
  margin: 0 0 32px;
}

.group__title {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 4px;
}

.group__note {
  color: var(--ink-2);
  margin: 0 0 16px;
}

.group > .grid,
.group > .person {
  margin-top: 14px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 20px;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid .wide {
    grid-column: 1 / -1;
  }
}

.field {
  margin: 0 0 18px;
  min-width: 0;
}

.field > label,
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 6px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
}

select {
  padding-right: 32px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 2px;
  border-color: var(--brand);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-2);
  opacity: 0.8;
}

input[type="checkbox"] {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--brand);
}

input[type="file"] {
  padding: 9px 12px;
  font-size: 0.9375rem;
}

.has-error input,
.has-error select,
.has-error textarea {
  border-color: var(--err);
  box-shadow: inset 0 0 0 1px var(--err);
}

.hint {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.error-text {
  display: block;
  margin-top: 6px;
  color: var(--err);
  font-weight: 600;
  font-size: 0.875rem;
}

.check,
.field > label.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.45;
}

.check input[type="checkbox"] {
  margin-top: 3px;
}

.field--check {
  margin-bottom: 8px;
}

.cite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 0 12px;
  align-items: start;
}

/* collapsible person / vehicle groups */

.person {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0 0 12px;
}

.person > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 16px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.person > summary::-webkit-details-marker {
  display: none;
}

.person > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg);
  transition: transform 120ms ease;
  flex: 0 0 auto;
}

.person[open] > summary::before {
  transform: rotate(45deg);
}

.person[open] > summary {
  border-bottom: 1px solid var(--line);
}

.summary__meta {
  margin-left: auto;
  font-weight: 450;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.person__fields {
  padding: 16px 16px 0;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  margin: 0;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius-s);
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-soft);
}

.btn--primary {
  color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
}

.btn--primary:hover {
  background: var(--brand);
  filter: brightness(1.08);
}

.btn--danger {
  color: var(--err);
  border-color: var(--err);
}

.btn--danger:hover {
  background: var(--err-soft);
}

.btn--quiet {
  color: var(--ink-2);
  border-color: transparent;
  background: transparent;
  padding: 8px 10px;
}

.btn--quiet:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.9375rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* sticky save bar on long forms */

.actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  margin: 8px -16px 0;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.actions .btn {
  flex: 1 1 0;
}

@media (min-width: 720px) {
  .actions {
    margin: 8px 0 0;
    padding: 12px 0;
    justify-content: flex-end;
  }

  .actions .btn {
    flex: 0 0 auto;
    min-width: 160px;
  }
}

/* ---------- details / disclosure ---------- */

details.disclosure {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
  margin: 0 0 20px;
}

details.disclosure + details.disclosure {
  border-top: 0;
  margin-top: -20px;
}

details.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

details.disclosure > summary::-webkit-details-marker {
  display: none;
}

details.disclosure > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
  flex: 0 0 auto;
}

details.disclosure[open] > summary::before {
  transform: rotate(45deg);
}

details.disclosure > :not(summary) {
  margin-bottom: 12px;
}

details.disclosure--danger > summary::before {
  border-color: var(--err);
}

/* ---------- login ---------- */

.main--login {
  max-width: 440px;
  padding-top: 40px;
}

.login .page-title {
  margin-top: 8px;
}

.form-card {
  padding: 24px 20px;
}

.form-card .btn {
  margin-top: 4px;
}

.help {
  margin-top: 24px;
}

/* ---------- intake wizard ---------- */

.wizard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.stepper {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.stepper li {
  flex: 1 1 0;
  min-width: 0;
}

.stepper a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 0;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--radius-s);
}

.stepper__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.stepper a.done .stepper__num {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
}

.stepper a[aria-current="step"] .stepper__num {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}

.stepper__text {
  display: none;
}

.stage {
  min-width: 0;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 20px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

@media (min-width: 920px) {
  .wizard {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 20px;
  }

  .stepper {
    flex-direction: column;
    gap: 2px;
  }

  .stepper a {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    min-height: 56px;
  }

  .stepper a:hover {
    background: var(--surface);
  }

  .stepper a[aria-current="step"] {
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
  }

  .stepper__num {
    width: 32px;
    height: 32px;
  }

  .stepper__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
  }

  .stepper__title {
    font-weight: 600;
    font-size: 0.9375rem;
  }

  .stepper__meta {
    font-size: 0.8125rem;
    color: var(--ink-2);
  }
}

/* documents */

.docs {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.docs li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.docs a {
  font-weight: 600;
}

.docs .meta {
  flex-basis: 100%;
}

.preview {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
}

.evidence {
  margin: 8px 0 12px;
  padding: 14px;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.875rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

/* research */

.price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}

.price__big {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.price__unit,
.price__note {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.price__note {
  flex-basis: 100%;
}

.empty {
  padding: 28px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
}

.empty h2 {
  margin-bottom: 6px;
}

/* status band on plans */

.band {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  font-weight: 550;
}

.band--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.band--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.band--muted {
  background: var(--surface-2);
  color: var(--ink-2);
}

.inline-form {
  margin: 0;
}

.approve {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
