/* ReadyFileCo brand (shared/brand.py): teal, cream, mint, peach, lavender. */
:root {
  --teal: #1F4E5A;
  --teal-dark: #163942;
  --cream: #F7F3EC;
  --mint: #DDF1E4;
  --peach: #FBD9C4;
  --lavender: #E3D9F5;
  --ink: #1d2b2f;
  --muted: #55666b;
  --line: #d9d2c5;      /* dividers and card edges */
  --control: #8C8577;   /* form control borders: 3.7:1 on white, 3.3:1 on cream (WCAG 1.4.11) */
  --white: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--teal); }

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

header.site {
  padding: 18px 0 8px;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand {
  font-weight: 800;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand span { font-weight: 500; color: var(--muted); }

.hero { padding: 20px 0 8px; }
.hero h1 {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero p { margin: 0 0 8px; color: var(--muted); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

form .field { margin: 0 0 18px; border: 0; padding: 0; }
form .field:last-child { margin-bottom: 0; }
form label.top, form legend {
  display: block;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--teal-dark);
  padding: 0;
}
select, input[type=number], input[type=text] {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--control);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}
/* Teal focus ring: 7.7:1 or more against every background on the page (lavender was 1.2:1). */
select:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible, .choice input:focus-visible + span {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { flex: 1 1 140px; position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1px solid var(--control);
  border-radius: 10px;
  cursor: pointer;
  background: var(--white);
}
.choice input:checked + span {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
  font-weight: 700;
}
.help { font-size: 0.9rem; color: var(--muted); margin: 6px 0 0; }

.result:focus { outline: none; }
.result-card {
  background: var(--mint);
  border-radius: var(--radius);
  padding: 20px;
}
.result-card h3 { margin: 22px 0 6px; color: var(--teal); font-size: 1.05rem; }
.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
}
.amount {
  margin: 4px 0 0;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  line-height: 1.1;
  color: var(--teal-dark);
  letter-spacing: -0.02em;
}
.amount-none { font-size: 2rem; }
.amount-sub { margin: 2px 0 10px; color: var(--muted); }
.detail { margin: 8px 0; }

.deposits {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95rem;
}
.deposits th, .deposits td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.deposits th { background: var(--cream); font-size: 0.85rem; color: var(--muted); }
.deposits tr:last-child td { border-bottom: 0; }
.deposits .label { white-space: nowrap; }
.deposits .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  margin: 10px 0 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--white);
}
.badge-official { background: var(--white); color: #2E7D32; }
.badge-third_party, .badge-unverified, .badge-not_published, .badge-warn { background: var(--peach); color: #9A2E0E; }

.notes { margin: 18px 0 0; padding-left: 20px; font-size: 0.95rem; }
.notes li { margin: 0 0 6px; }

.source { font-size: 0.88rem; color: var(--muted); margin: 16px 0 0; }

.tracker {
  margin: 16px 0 0;
  background: var(--lavender);
  border-radius: var(--radius);
  padding: 20px;
}
.tracker h3 { margin: 0 0 6px; color: var(--teal); }
.tracker p { margin: 0 0 14px; }
.button {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 10px;
}
.button:hover { background: var(--teal-dark); }

.hint { color: var(--muted); margin: 0; }

/* Tax calculator additions */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid .field { margin-bottom: 18px; }
.money { position: relative; }
.money::before {
  content: "$";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.money input { padding-left: 26px; }
.spacer { display: block; font-weight: 700; margin: 0 0 6px; }
.panel h2 { margin: 4px 0 14px; font-size: 1.05rem; color: var(--teal); }
.panel + .spacer { display: block; font-weight: 700; margin: 0 0 6px; }
.panel h2 { margin-top: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); }
.deposits { margin: 0 0 8px; }
.deposits tr.past td { color: var(--muted); }
.deposits tr.total td { font-weight: 700; background: var(--cream); }
.workings { margin: 12px 0 0; }
.workings summary { cursor: pointer; font-weight: 600; color: var(--teal); margin: 0 0 8px; }
.callout {
  background: var(--white);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 0;
  font-size: 0.95rem;
}

.explainer h2 { color: var(--teal); font-size: 1.25rem; margin: 26px 0 8px; }
.explainer ul { padding-left: 20px; }

footer.site {
  margin: 36px 0 0;
  padding: 20px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
footer.site p { margin: 0 0 8px; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; gap: 0; }
  .spacer { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .panel, .result-card, .tracker { padding: 16px; }
  .deposits th, .deposits td { padding: 8px; }
}

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

/* Same as the ESA calculator: hero date, cross-sell list, footer links. */
.hero .checked { font-size: 0.9rem; font-weight: 600; color: var(--teal); }
.more-from h2 { color: var(--teal); font-size: 1.25rem; margin: 30px 0 10px; }
.more-from ul { padding-left: 20px; margin: 0; }
.more-from li { margin: 0 0 6px; }
.more-from a, .footer-links a { font-weight: 600; }

/* Bottom answer bar (shown while the result is below the screen). */
.result { scroll-margin-top: 12px; }
/* Keep a focused field clear of the bar when the browser scrolls it into view. */
html { scroll-padding-bottom: 96px; }
.peek {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border: 0;
  background: var(--teal);
  color: var(--white);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(22, 57, 66, 0.18);
}
.peek[hidden] { display: none; }
.peek-amount { font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.peek-sub {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.25;
  opacity: 0.92;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.peek-go { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.peek:focus-visible { outline: 3px solid var(--lavender); outline-offset: -6px; }
@media (min-width: 761px) {
  .peek { left: 50%; right: auto; bottom: 16px; width: min(728px, calc(100% - 32px)); transform: translateX(-50%); border-radius: 12px; padding-bottom: 12px; }
}
