/* Fair-split calculator — settledivorce.co.uk */

/* The site is a light-themed brand. Pin the scheme so form controls and the
   page ground stay legible when the visitor's OS is set to dark. Safe to drop
   once the scaffold (#1) sets these globally. */
:root { color-scheme: light; }
html, body {
  background: #ffffff;
  color: #1c2523;
  margin: 0;
}

:root {
  --fs-brand: #2f6f5e;
  --fs-brand-dark: #235345;
  --fs-brand-light: #e8f1ee;
  --fs-brand-mid: #b7d3c9;
  --fs-accent: #b4562f;
  --fs-ink: #1c2523;
  --fs-ink-soft: #4d5a56;
  --fs-line: #d5ded9;
  --fs-bg: #ffffff;
  --fs-bg-soft: #f6f9f7;
  --fs-radius: 10px;
}

.fs {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem var(--page-gutter, 1rem) 3rem;
  color: var(--fs-ink);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

.fs h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 .5rem; }
.fs h2 { font-size: 1.3rem; line-height: 1.3; margin: 2.5rem 0 .75rem; }
.fs h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
.fs p { margin: 0 0 1rem; }
.fs__lede { font-size: 1.075rem; color: var(--fs-ink-soft); }

.fs a { color: var(--fs-brand-dark); }
.fs :focus-visible {
  outline: 3px solid var(--fs-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Disclaimer ---------------------------------------------------------- */
.fs-disclaimer {
  border: 2px solid var(--fs-brand);
  border-left-width: 6px;
  background: var(--fs-brand-light);
  border-radius: var(--fs-radius);
  padding: .9rem 1rem;
  margin: 0 0 1.75rem;
}
.fs-disclaimer p { margin: 0; font-size: .95rem; }
.fs-disclaimer strong { display: block; margin-bottom: .2rem; }
.fs-disclaimer--foot { margin: 2.5rem 0 0; }

/* Form ---------------------------------------------------------------- */
.fs-form { margin: 0; }
.fs-fieldset {
  border: 1px solid var(--fs-line);
  border-radius: var(--fs-radius);
  padding: 1rem 1rem 1.25rem;
  margin: 0 0 1.25rem;
  min-width: 0;
}
.fs-fieldset > legend {
  font-weight: 600;
  padding: 0 .4rem;
  color: var(--fs-brand-dark);
}
.fs-hint { font-size: .875rem; color: var(--fs-ink-soft); margin: 0 0 1rem; }

.fs-grid { display: grid; gap: 1rem; }
@media (min-width: 34rem) {
  .fs-grid--2 { grid-template-columns: 1fr 1fr; }
}

.fs-field { display: flex; flex-direction: column; gap: .35rem; }
.fs-field > label { font-weight: 600; font-size: .95rem; }
.fs-field__hint { font-size: .825rem; color: var(--fs-ink-soft); }

.fs-input-wrap { position: relative; display: flex; align-items: stretch; }
.fs-prefix {
  display: flex; align-items: center;
  padding: 0 .6rem;
  background: var(--fs-bg-soft);
  border: 1px solid var(--fs-line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: var(--fs-ink-soft);
  font-weight: 600;
}
.fs-prefix + input { border-radius: 0 8px 8px 0; }
.fs-input-wrap input { flex: 1 1 auto; }

/* Grid rows stretch their cells, so pin the control to the top of the cell
   rather than letting it grow to match a taller neighbour. */
.fs-field > input,
.fs-field > .fs-input-wrap { margin-top: auto; align-self: stretch; }
.fs-field { justify-content: flex-start; }
.fs-field > input { flex: none; }

.fs input[type="number"],
.fs input[type="text"] {
  min-width: 0;
  width: 100%;
  font: inherit;
  font-size: 1rem; /* keeps iOS from zooming on focus */
  padding: .6rem .7rem;
  border: 1px solid var(--fs-line);
  border-radius: 8px;
  background: var(--fs-bg);
  color: inherit;
}
.fs input:focus { border-color: var(--fs-brand); }

.fs-radios { display: grid; gap: .5rem; margin-top: .25rem; }
.fs-radio, .fs-check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem .7rem;
  border: 1px solid var(--fs-line);
  border-radius: 8px;
  background: var(--fs-bg);
  cursor: pointer;
  font-size: .95rem;
}
.fs-radio input, .fs-check input {
  margin: .2rem 0 0;
  width: 1.15rem; height: 1.15rem;
  accent-color: var(--fs-brand);
  flex: none;
}
.fs-radio:has(input:checked), .fs-check:has(input:checked) {
  border-color: var(--fs-brand);
  background: var(--fs-brand-light);
}
.fs-checks { display: grid; gap: .5rem; }
.fs-checks + .fs-checks { margin-top: 1rem; }
.fs-checks__title { font-weight: 600; font-size: .95rem; margin: 0 0 .1rem; }

/* Result -------------------------------------------------------------- */
.fs-result {
  border: 1px solid var(--fs-brand-mid);
  border-radius: var(--fs-radius);
  background: var(--fs-bg-soft);
  padding: 1.1rem 1rem 1.25rem;
  margin: 1.75rem 0 0;
}
.fs-result h2 { margin-top: 0; }
.fs-range {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fs-brand-dark);
  margin: 0 0 .35rem;
  line-height: 1.3;
}
.fs-money { font-size: .95rem; color: var(--fs-ink-soft); margin: 0 0 1.25rem; }

.fs-meter { margin: 0 0 .35rem; }
.fs-track {
  position: relative;
  height: 2.5rem;
  background: linear-gradient(90deg, #eef3f1, #ffffff, #eef3f1);
  border: 1px solid var(--fs-line);
  border-radius: 8px;
  overflow: hidden;
}
.fs-band {
  position: absolute; top: 0; bottom: 0;
  background: var(--fs-brand);
  opacity: .28;
  transition: left .2s ease, width .2s ease;
}
.fs-centre {
  position: absolute; top: -2px; bottom: -2px;
  width: 3px;
  margin-left: -1.5px;
  background: var(--fs-brand-dark);
  transition: left .2s ease;
}
.fs-fifty {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: var(--fs-ink-soft);
  opacity: .45;
}
.fs-scale {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--fs-ink-soft);
  margin: .3rem 0 1rem;
}
.fs-scale span:nth-child(2) { text-align: center; }

.fs-verdict {
  border-left: 4px solid var(--fs-brand);
  padding: .6rem .8rem;
  border-radius: 0 8px 8px 0;
  background: var(--fs-bg);
  font-size: .95rem;
  margin: 0 0 1.25rem;
}
.fs-verdict--out { border-left-color: var(--fs-accent); }

.fs-send { margin: 0 0 1.5rem; }
.fs-send__link { font-weight: 700; font-size: .92rem; }

.fs-factors { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.fs-factor {
  background: var(--fs-bg);
  border: 1px solid var(--fs-line);
  border-radius: 8px;
  padding: .7rem .8rem;
}
.fs-factor__head {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 .3rem;
}
.fs-factor__name { font-weight: 600; font-size: .95rem; }
.fs-factor__note { margin: 0; font-size: .9rem; color: var(--fs-ink-soft); }
.fs-tag {
  font-size: .775rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.fs-tag--a { background: var(--fs-brand); color: #fff; }
.fs-tag--b { background: var(--fs-brand-dark); color: #fff; }
.fs-tag--neutral { background: #e6ebe9; color: var(--fs-ink-soft); }

/* Cost table ---------------------------------------------------------- */
.fs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .925rem;
  min-width: 34rem;
}
.fs-table caption {
  text-align: left;
  font-size: .875rem;
  color: var(--fs-ink-soft);
  padding: 0 0 .6rem;
}
.fs-table th, .fs-table td {
  text-align: left;
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--fs-line);
  vertical-align: top;
}
.fs-table thead th {
  background: var(--fs-brand);
  color: #fff;
  font-weight: 600;
  border-bottom: 0;
}
.fs-table thead th:first-child { border-radius: 8px 0 0 0; }
.fs-table thead th:last-child { border-radius: 0 8px 0 0; }
.fs-table tbody th { font-weight: 600; }
.fs-table tbody tr:nth-child(even) { background: var(--fs-bg-soft); }
.fs-table td.fs-num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* On narrow screens a five-column table with a prose column is unreadable, so
   each row becomes its own card. The table markup is untouched, so screen
   readers still get proper header association. */
@media (max-width: 44rem) {
  .fs-table { min-width: 0; }
  .fs-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .fs-table tbody tr {
    display: block;
    border: 1px solid var(--fs-line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: .75rem;
    background: var(--fs-bg);
  }
  .fs-table tbody tr:nth-child(even) { background: var(--fs-bg); }
  .fs-table tbody th {
    display: block;
    background: var(--fs-brand);
    color: #fff;
    padding: .6rem .8rem;
    border-bottom: 0;
  }
  .fs-table tbody td {
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    align-items: baseline;
    padding: .5rem .8rem;
  }
  .fs-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--fs-ink);
    flex: none;
  }
  .fs-table tbody td:last-child {
    display: block;
    border-bottom: 0;
    background: var(--fs-bg-soft);
  }
  .fs-table tbody td:last-child::before {
    display: block;
    margin-bottom: .15rem;
  }
}

/* CTA ----------------------------------------------------------------- */
.fs-cta {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1rem;
  background: var(--fs-brand);
  border-radius: var(--fs-radius);
  color: #fff;
  text-align: center;
}
.fs-cta h2 { color: #fff; margin: 0 0 .4rem; }
.fs-cta p { margin: 0 0 1rem; opacity: .92; font-size: .95rem; }
.fs-btn {
  display: inline-block;
  background: #fff;
  color: var(--fs-brand-dark);
  font-weight: 700;
  text-decoration: none;
  padding: .8rem 1.4rem;
  border-radius: 8px;
  border: 2px solid #fff;
}
.fs-btn:hover, .fs-btn:focus { background: var(--fs-brand-light); }
.fs-cta :focus-visible { outline-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .fs-band, .fs-centre { transition: none; }
}
