/* Bench Walk Pricing Calculator — visual design
 *
 * Brand palette and typography sourced from benchwalk.com:
 *   navy   #172751   primary
 *   sky    #a9bcd8   accent
 *   mist   #edf3fc   hover / soft fill
 *   body font: omnes-pro → Helvetica Neue → Arial fallback
 *   heading font: "League Gothic" (uppercase, condensed)
 */

@import url("https://fonts.googleapis.com/css2?family=League+Gothic&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bw-navy:      #172751;
  --bw-navy-2:    #233a73;
  --bw-sky:       #a9bcd8;
  --bw-sky-soft:  #cdd9ea;
  --bw-mist:      #edf3fc;
  --bw-paper:     #ffffff;
  --bw-paper-2:   #f7f8fb;
  --bw-paper-3:   #ebeef4;
  --bw-rule:      #d8dde6;
  --bw-rule-2:    #b9c2d0;
  --bw-text:      #1c2536;
  --bw-text-soft: #59647a;
  --bw-good:      #2c7a4a;
  --bw-good-soft: #e5f1ea;
  --bw-good-rule: #b8d6c4;
  --bw-bad:       #a83232;
  --bw-bad-soft:  #f6eaea;
  --bw-bad-rule:  #ddb9b9;
  --bw-shadow:    0 1px 3px rgba(23, 39, 81, 0.07), 0 1px 2px rgba(23, 39, 81, 0.04);
  --bw-shadow-lg: 0 12px 32px rgba(23, 39, 81, 0.11), 0 4px 12px rgba(23, 39, 81, 0.06);

  --bw-heading-font: "League Gothic", "Oswald", "Arial Narrow", sans-serif;
  --bw-body-font:    "Inter", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bw-paper-2);
  color: var(--bw-text);
  font-family: var(--bw-body-font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bw-navy); text-decoration: underline; text-decoration-color: var(--bw-sky); text-underline-offset: 2px; }
a:hover { color: var(--bw-navy-2); text-decoration-color: var(--bw-navy); }

/* --- top bar -------------------------------------------------------- */

.brand-bar {
  background: var(--bw-navy);
  color: var(--bw-paper);
  padding: 22px 0;
  border-bottom: 4px solid var(--bw-sky);
}

.brand-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand-title {
  font-family: var(--bw-heading-font);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
}

.brand-title strong { font-weight: 400; }

.brand-sub {
  font-family: var(--bw-body-font);
  font-size: 11px;
  font-weight: 500;
  color: var(--bw-sky);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}

/* --- page layout --------------------------------------------------- */

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

h1.headline {
  font-family: var(--bw-heading-font);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--bw-navy);
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 28px;
  color: var(--bw-text-soft);
  max-width: 820px;
}

h2.section {
  font-family: var(--bw-heading-font);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bw-navy);
  color: var(--bw-navy);
  line-height: 1.1;
}

/* --- cards --------------------------------------------------------- */

.card {
  background: var(--bw-paper);
  border: 1px solid var(--bw-rule);
  border-radius: 2px;
  box-shadow: var(--bw-shadow);
  padding: 26px 30px;
  margin-bottom: 22px;
}

.card-help {
  color: var(--bw-text-soft);
  font-size: 13.5px;
  margin: 4px 0 18px;
  line-height: 1.55;
}

/* --- assumption note ----------------------------------------------- */

.assumption-note {
  background: var(--bw-mist);
  border: 1px solid var(--bw-sky-soft);
  border-left: 4px solid var(--bw-sky);
  padding: 18px 22px;
  font-size: 13.5px;
  color: var(--bw-text);
  margin: 0 0 26px;
  line-height: 1.55;
}

.assumption-note strong { color: var(--bw-navy); font-weight: 600; }

/* The opening disclaimer is all-bold, top-to-bottom. */
.assumption-note--bold strong { font-weight: 700; }
.assumption-note--bold strong a { color: var(--bw-navy); }

/* Consent checkbox + CTA hint */
.consent-row { margin-top: 18px; }
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bw-text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--bw-navy);
  cursor: pointer;
  flex-shrink: 0;
}
.consent a { color: var(--bw-navy); text-decoration-color: var(--bw-sky); }

.cta-hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--bw-text-soft);
  font-style: italic;
}
.cta-hint.hidden { display: none; }

button.primary:disabled {
  background: var(--bw-paper-3);
  color: var(--bw-text-soft);
  border-color: var(--bw-rule-2);
  cursor: not-allowed;
}
button.primary:disabled:hover {
  background: var(--bw-paper-3);
  color: var(--bw-text-soft);
}

/* Disclaimer modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 28, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadein 160ms ease-out;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bw-paper);
  border: 1px solid var(--bw-rule);
  border-top: 4px solid var(--bw-sky);
  padding: 28px 32px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--bw-shadow-lg);
  border-radius: 2px;
}
.modal h3 {
  font-family: var(--bw-heading-font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bw-navy);
  margin: 0 0 14px;
  border-bottom: 2px solid var(--bw-navy);
  padding-bottom: 8px;
}
.modal-body { font-size: 14px; line-height: 1.6; color: var(--bw-text); }
.modal-body p { margin: 0 0 14px; }
.modal-body strong { font-weight: 600; }
.modal-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

/* Matrix cell tint scale: hue interpolates from red (0deg) at the "low"
 * threshold to green (120deg) at the "high" threshold. Applied via inline
 * style from app.js — these rules just set a hover affordance. */
table.matrix td.cell.tinted { transition: filter 80ms; }
table.matrix td.cell.tinted:hover { filter: brightness(0.96); }

.contact-list { margin: 8px 0 0; padding: 0; list-style: none; }
.contact-list li { display: inline-block; margin-right: 18px; }

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

label {
  display: block;
  font-family: var(--bw-body-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--bw-text-soft);
  text-transform: uppercase;
  margin-bottom: 5px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select {
  font-family: var(--bw-body-font);
  font-size: 15px;
  padding: 9px 12px;
  width: 100%;
  border: 1px solid var(--bw-rule-2);
  border-radius: 2px;
  background: var(--bw-paper);
  color: var(--bw-text);
  transition: border-color 120ms, box-shadow 120ms;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--bw-navy);
  box-shadow: 0 0 0 2px var(--bw-sky-soft);
}

input.num { text-align: right; font-variant-numeric: tabular-nums; }

.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* --- budget table -------------------------------------------------- */

.budget-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--bw-body-font);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.budget-table thead th {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--bw-text-soft);
  font-weight: 600;
  padding: 8px 10px;
  text-align: right;
  border-bottom: 2px solid var(--bw-navy);
  background: var(--bw-paper-2);
}

.budget-table thead th:first-child,
.budget-table thead th:nth-child(2) { text-align: left; }

.budget-table tbody td {
  padding: 4px 4px;
  border-bottom: 1px solid var(--bw-paper-3);
}

.budget-table tbody td input {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.budget-table tbody td input:hover { border-color: var(--bw-rule); background: var(--bw-paper-2); }
.budget-table tbody td input:focus { background: var(--bw-paper); }

.budget-table tbody td:first-child input,
.budget-table tbody td:nth-child(2) input { text-align: left; }

.budget-table tbody td.row-total {
  padding-right: 10px;
  text-align: right;
  color: var(--bw-text-soft);
}

.budget-table tfoot td {
  padding: 10px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-top: 2px solid var(--bw-navy);
  background: var(--bw-paper-2);
}

.budget-table tfoot td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--bw-text-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cfa-row td {
  background: var(--bw-mist);
  padding: 10px 4px;
  border-top: 1px solid var(--bw-sky-soft);
  border-bottom: 1px solid var(--bw-sky-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Right-align CFA-row inputs so they sit under the numeric column headers
 * (rather than the default left-aligned number-input rendering). Match the
 * padding of the body-row inputs so the digits line up exactly. The
 * !important is needed to beat WebKit's UA stylesheet for input[type=number]. */
.cfa-row td input {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  padding: 6px 8px;
  border: 1px solid transparent;
  background: transparent;
}
.cfa-row td input:hover { border-color: var(--bw-rule); background: var(--bw-paper); }
.cfa-row td input:focus { background: var(--bw-paper); }

/* The disbursements column has no editable CFA — it's always 100%. We render
 * it as a span styled like a disabled input so it sits on the same baseline
 * and right edge as the editable inputs. */
.cfa-row td.cfa-disb {
  color: var(--bw-text-soft);
  padding-right: 16px;
}

.cfa-row td:first-child {
  font-style: normal;
  color: var(--bw-navy);
  font-weight: 500;
  padding-left: 12px;
  text-align: left;
}

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

.cta { margin-top: 32px; text-align: center; }

button.primary {
  font-family: var(--bw-body-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 44px;
  background: var(--bw-navy);
  color: var(--bw-paper);
  border: 2px solid var(--bw-navy);
  border-radius: 0;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

button.primary:hover {
  background: var(--bw-paper);
  color: var(--bw-navy);
}

button.primary:active { transform: translateY(1px); }

button.secondary {
  font-family: var(--bw-body-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 7px 14px;
  background: var(--bw-paper);
  color: var(--bw-navy);
  border: 1px solid var(--bw-rule-2);
  border-radius: 0;
  cursor: pointer;
}

button.secondary:hover { border-color: var(--bw-navy); background: var(--bw-mist); }

.toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }

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

#results { display: none; }
#results.visible { display: block; animation: fadein 240ms ease-out; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.interest-banner {
  padding: 22px 26px;
  border-radius: 2px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.interest-banner.likely {
  background: var(--bw-good-soft);
  border-left: 4px solid var(--bw-good);
  color: #143f24;
}

.interest-banner.unlikely {
  background: var(--bw-bad-soft);
  border-left: 4px solid var(--bw-bad);
  color: #4b1b1b;
}

.interest-icon {
  font-size: 22px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--bw-body-font);
}

.likely .interest-icon { background: var(--bw-good); color: white; }
.unlikely .interest-icon { background: var(--bw-bad); color: white; }

.interest-banner .text { line-height: 1.5; }
.interest-banner .text strong {
  font-family: var(--bw-heading-font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  color: var(--bw-navy);
}
.likely .text strong { color: #143f24; }
.unlikely .text strong { color: #4b1b1b; }
.interest-banner .text .sub { font-size: 14px; }

/* --- matrix -------------------------------------------------------- */

.matrix-card { overflow-x: auto; }

.matrix-axis-label {
  font-family: var(--bw-body-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bw-text-soft);
  text-align: center;
  margin: 8px 0;
}

table.matrix {
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  width: 100%;
  min-width: 720px;
}

table.matrix th, table.matrix td {
  padding: 9px 14px;
  text-align: right;
  border-bottom: 1px solid var(--bw-paper-3);
}

table.matrix thead th {
  font-family: var(--bw-body-font);
  font-size: 11px;
  font-weight: 600;
  color: var(--bw-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  background: var(--bw-mist);
  border-bottom: 2px solid var(--bw-navy);
}

table.matrix tbody th {
  text-align: left;
  font-family: var(--bw-body-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--bw-navy);
  background: var(--bw-paper-2);
  border-right: 1px solid var(--bw-rule);
}

table.matrix td.cell { background: var(--bw-paper); }
table.matrix td.zero { color: var(--bw-text-soft); opacity: 0.5; }

/* --- disclaimer ---------------------------------------------------- */

.disclaimer {
  font-size: 12.5px;
  color: var(--bw-text-soft);
  line-height: 1.6;
  background: var(--bw-paper-3);
  padding: 18px 22px;
  border-left: 4px solid var(--bw-sky);
  margin-top: 20px;
}

.disclaimer strong { color: var(--bw-navy); }

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

footer.foot {
  border-top: 1px solid var(--bw-rule);
  margin-top: 60px;
  padding: 28px 0;
  background: var(--bw-navy);
  color: var(--bw-sky);
  font-size: 12px;
  letter-spacing: 0.06em;
}

footer .brand-inner { font-family: var(--bw-body-font); text-transform: uppercase; }

/* --- responsive ---------------------------------------------------- */

@media (max-width: 760px) {
  .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
  .brand-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  h1.headline { font-size: 40px; }
  h2.section { font-size: 22px; }
}
