/* Social Security Calculator (US) — shared stylesheet.
   Adapted from the house calculator design, Nov 2026. Plain, fast, no external fonts or libraries.
   Mobile-first: single column, sticky answer bar; desktop: inputs left,
   results sticky on the right. */

* { box-sizing: border-box; }

:root {
  --green-900: #0b3d26;
  --green-800: #0e4d2e;
  --green-700: #14532d;
  --green-600: #1b7a4d;
  --green-50: #eaf6ee;
  --ink: #14201a;
  --muted: #5b6b60;
  --line: #e4e9e5;
  --bg: #f7f8f6;
  --card: #ffffff;
  --amber-bg: #fff9e6;
  --amber-line: #d9a514;
  --red: #b3261e;
  --red-bg: #fdecea;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.05), 0 10px 30px rgba(16, 24, 20, 0.06);
  --radius: 16px;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--green-700); }
a:hover { color: var(--green-600); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header & nav ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 0 10px;
}

header.site .site-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

header.site .site-title a { color: var(--green-700); text-decoration: none; }

header.site .tagline {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

nav.main {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
nav.main::-webkit-scrollbar { display: none; }

nav.main a {
  flex: 0 0 auto;
  color: #1d2b22;
  background: #f1f4f2;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
nav.main a:hover { background: #e2ebe5; color: var(--green-700); }
nav.main a.current { background: var(--green-700); color: #fff; }

/* ---------- hero & headings ---------- */

main { padding: 20px 0 64px; }

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(180deg, #eaf5ec 0%, #f4faf5 60%, #e7f3ea 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  margin-top: 4px;
}

.page-hero {
  background: linear-gradient(180deg, #f0f7f1 0%, #fafdfb 60%, #edf5ee 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin-top: 4px;
}
.page-hero h1 { margin-bottom: 10px; }
.page-hero .lede { margin-bottom: 0; }

@media (max-width: 640px) {
  .hero { padding: 22px 20px; }
  .page-hero { padding: 20px 18px; }
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green-600);
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.015em; margin: 44px 0 10px; }
h3 { font-size: 1.12rem; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 24px; }
li { margin-bottom: 8px; }

.lede { font-size: 1.12rem; line-height: 1.55; color: #33473a; max-width: 62ch; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
  padding: 0;
  list-style: none;
}
.chips li {
  margin: 0;
  background: var(--green-50);
  color: var(--green-800);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
}

/* ---------- calculator ---------- */

.calc-layout { margin-top: 24px; }

.calc-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.calc-box h2 { margin: 0 0 4px; }
.calc-box > p.sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 0.98rem; margin-bottom: 6px; }
.field .hint { display: block; font-size: 0.86rem; font-weight: 400; color: var(--muted); margin-top: 6px; line-height: 1.45; }

.field input[type="number"],
.field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.3;
  border: 1.5px solid #cbd5cf;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field input[type="number"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(27, 122, 77, 0.18);
}

.money-input { position: relative; display: block; }
.money-input > span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  pointer-events: none;
}
.money-input input[type="number"] { padding-left: 30px; }

.field-row { display: flex; flex-wrap: wrap; gap: 0 20px; }
.field-row .field { flex: 1 1 240px; }

.check { font-weight: 700; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--green-700);
  cursor: pointer;
}

button.example-btn {
  background: #fff;
  color: var(--green-700);
  border: 1.5px solid var(--green-700);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
button.example-btn:hover { background: var(--green-50); }

/* ---------- results (dark green panel) ---------- */

.results {
  background: var(--green-800);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}

.results .big-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bfe3cd;
}

.results .big {
  margin: 4px 0 4px;
  font-size: clamp(2.4rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
}

.results .big-sub {
  margin: 0 0 8px;
  color: #d6ecdf;
  font-size: 0.98rem;
}

.results dl { margin: 10px 0 0; }
.results .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.results .row dt { font-weight: 600; color: #e6f3ea; }
.results .row dd { margin: 0; text-align: right; font-weight: 700; white-space: nowrap; }
.results .row.total-row dt,
.results .row.total-row dd {
  font-size: 1.08rem;
  font-weight: 800;
  color: #fff;
}

.results h3 {
  margin: 22px 0 2px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.05rem;
}

.results .note {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid #e8c547;
  color: #eef7f0;
  margin-top: 18px;
}

.no-result {
  background: var(--red-bg);
  border: 1px solid #e0a9a4;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 18px;
}
.no-result p { color: #6d1a15; }

/* ---------- sticky answer bar (mobile only) ---------- */

.sticky-bar {
  position: sticky;
  bottom: 12px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
  background: var(--green-900);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(11, 61, 38, 0.35);
  padding: 13px 20px;
}
.sticky-bar span { font-size: 0.9rem; color: #bfe3cd; font-weight: 600; }
.sticky-bar strong { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 16px; -webkit-overflow-scrolling: touch; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
}
th, td { padding: 11px 12px 11px 0; text-align: left; vertical-align: top; }
th:first-child, td:first-child { padding-left: 12px; }
th {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}
td { border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }

/* ---------- example & explainer cards ---------- */

.example {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 24px 0;
}
.example h3 { margin-top: 0; }
.example dl {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0 16px;
  margin: 12px 0 0;
}
.example dl dt, .example dl dd { padding: 9px 0; border-top: 1px solid var(--line); }
.example dl dt:first-of-type, .example dl dd:first-of-type { border-top: none; }
.example dt { font-weight: 600; }
.example dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }

.note {
  background: var(--amber-bg);
  border: 1px solid #f0e2b0;
  border-left: 4px solid var(--amber-line);
  padding: 12px 16px;
  border-radius: 0 12px 12px 0;
  font-size: 0.95rem;
}

/* ---------- ad slots (hidden until AdSense is approved) ---------- */

.ad-slot { display: none; }

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

footer.site {
  background: var(--green-900);
  color: #bfd8c8;
  padding: 32px 0 40px;
  font-size: 0.9rem;
}
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 16px; }
footer.site nav a {
  color: #dff0e6;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}
footer.site nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
footer.site p { margin: 0; }

/* ---------- desktop layout ---------- */

@media (min-width: 960px) {
  nav.main { flex-wrap: wrap; overflow-x: visible; }

  .calc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    gap: 24px;
    align-items: start;
  }

  .calc-layout .results-col { position: sticky; top: 132px; }

  .sticky-bar { display: none !important; }

  .field-row .field { flex-basis: 0; }
}

/* ---------- social security extras ---------- */

.mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.mode-toggle label {
  flex: 1 1 200px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--green-50);
  border: 1.5px solid #cfe3d6;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.mode-toggle label:has(input:checked) {
  border-color: var(--green-600);
  background: #dff0e4;
}
.mode-toggle input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green-700);
  cursor: pointer;
}
.mode-toggle .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 2px;
}

.claim-table td.hl, .claim-table th.hl { font-weight: 800; color: var(--green-800); }
.claim-table tr.best td { background: var(--green-50); }
