:root {
  --ground: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #14213D;
  --muted: #3A4658;
  --line: #D5DBE3;
  --accent: #0B6E4F;
  --accent-dark: #095A41;
  --accent-soft: #E3F1EC;
  --danger: #9B1C1C;
  --danger-soft: #FBEAEA;
}

* { box-sizing: border-box; }

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

a { color: var(--accent-dark); }
a:hover { color: var(--ink); }

h1 { font-size: 30px; line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 8px; }
p { margin: 0 0 14px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 32px; padding-bottom: 64px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.brand svg { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 10px 0; }
.nav a:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 10px 0; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; }
.link-button:hover { text-decoration: underline; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 15px; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px;
  background: var(--accent); color: #FFFFFF;
  border: 1px solid var(--accent); border-radius: 8px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #FFFFFF; }
.nav a.button { color: #FFFFFF; padding: 0 16px; }
.nav a.button:hover { text-decoration: none; }
.button-small { min-height: 44px; padding: 0 16px; }
.button-outline { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.button-outline:hover { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.button-wide { width: 100%; margin-top: 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card-dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.card-dark .muted, .card-dark .eyebrow { color: #C9D2E0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.grid .card { margin-bottom: 0; }
.grid { margin-bottom: 20px; }

.eyebrow { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.big { font-size: 32px; font-weight: 700; line-height: 1.2; margin: 6px 0; }
.muted { color: var(--muted); }
.card .muted:last-child { margin-bottom: 0; }

.hero { text-align: center; padding: 48px 0; }
.hero h1 { font-size: 40px; }
.lead { font-size: 20px; color: var(--muted); max-width: 560px; margin: 0 auto 20px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.invited { background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 10px 14px; display: inline-block; }
.card .invited { display: block; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 46px; padding: 0 12px;
  border: 1px solid #6B7688; border-radius: 8px;
  font: inherit; color: var(--ink); background: #FFFFFF;
}
.field input:focus, .copy-input:focus, .button:focus-visible, .link-button:focus-visible, a:focus-visible {
  outline: 3px solid #7FB8A4; outline-offset: 2px;
}
.field.has-error input { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: 15px; margin-top: 6px; }

.alert { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.notice { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; }

.below { margin: 16px 0 0; }

/* Hidden field that only automated sign-up scripts fill in. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.copy-row { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-input {
  flex: 1 1 260px; min-width: 0; min-height: 46px; padding: 0 12px;
  border: 1px solid #6B7688; border-radius: 8px;
  font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 15px;
  color: var(--ink); background: var(--ground);
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); }
.table thead th { border-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

@media (max-width: 480px) {
  h1 { font-size: 26px; }
  .hero h1 { font-size: 32px; }
  .card { padding: 18px; }
}

/* ---- Stage two: back office ---- */
.intro { font-size: 18px; color: var(--muted); max-width: 720px; }
.disclosure { font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; max-width: 720px; margin-bottom: 20px; }
.section-title { margin: 28px 0 12px; }

.program { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.program p { margin: 0; }
.program-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; width: 100%; }
.program-head h2 { margin: 0; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.status { font-size: 15px; color: var(--muted); margin: 0; }
.card > .status { margin-top: 12px; }
.status-ok { color: var(--accent-dark); font-weight: 600; }
.status-warn { color: #8A4B08; font-weight: 600; }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; margin-bottom: 0; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.step-body { flex: 1 1 260px; display: flex; flex-direction: column; }
.step-body .muted { font-size: 15px; }

.field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #6B7688; border-radius: 8px;
  font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 15px; line-height: 1.5;
  color: var(--ink); background: #FFFFFF; resize: vertical;
}
.field textarea:focus { outline: 3px solid #7FB8A4; outline-offset: 2px; }
.field.has-error textarea { border-color: var(--danger); }

.table-scroll { overflow-x: auto; }
.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 14px; }
.row-actions .link-button { color: var(--accent-dark); text-decoration: underline; }
.cancel { margin-left: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Programs page: one card per program, with the member's link box ---- */
.grid.programs { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.program { padding: 0; overflow: hidden; display: block; scroll-margin-top: 16px; }
.program-banner { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--ground); border-bottom: 1px solid var(--line); }
.program-body { padding: 20px 24px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.link-box { width: 100%; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.link-box label { display: block; font-weight: 600; margin-bottom: 4px; }
.link-box .hint { color: var(--muted); font-size: 15px; margin-bottom: 8px; overflow-wrap: anywhere; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-row input {
  flex: 1 1 180px; min-width: 0; min-height: 46px; padding: 0 12px;
  border: 1px solid #6B7688; border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--ink); background: #FFFFFF;
}
.link-row input:focus { outline: 3px solid #7FB8A4; outline-offset: 2px; }
.link-box.has-error .link-row input { border-color: var(--danger); }
.link-box .error { color: var(--danger); font-size: 15px; margin-top: 8px; overflow-wrap: anywhere; }
.link-box .status { margin-top: 8px; }

.banner-preview { display: block; width: 100%; max-width: 360px; aspect-ratio: 1200 / 630; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 10px; min-height: 44px; }
.field .check input { width: 20px; height: 20px; min-height: 0; padding: 0; }
.field input[type=file] { border: 1px dashed #6B7688; padding: 10px 12px; height: auto; background: var(--ground); }

.cost { margin: 0; font-weight: 600; }
.cost-label { display: inline-block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-right: 6px; }

/* ---- Stage three: training, calculator, members admin ---- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.subnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.subnav a:hover { border-color: var(--ink); }
.subnav a.current { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.crumb { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .intro { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--ink); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-summary { font-size: 18px; }
.lesson-notes { overflow-wrap: anywhere; margin-bottom: 16px; }
.complete-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }
.link-button.underline { text-decoration: underline; color: var(--accent-dark); }
.lesson-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

.lesson-list { padding: 8px 0; }
.lesson-list h2 { padding: 12px 24px 4px; margin: 0; }
.lesson-list ul { list-style: none; margin: 0; padding: 0; }
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 12px 24px; min-height: 56px; color: var(--ink); text-decoration: none; }
.lesson-row:hover { background: var(--ground); color: var(--ink); }
.tick { width: 24px; height: 24px; flex-shrink: 0; border: 2px solid #6B7688; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.tick-done { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.lesson-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lesson-title { font-weight: 600; }
.lesson-sub { color: var(--muted); font-size: 15px; }
.lesson-state { flex-shrink: 0; font-size: 14px; color: var(--muted); }

.field textarea.prose { font-family: inherit; font-size: 16px; }

.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.calc .card { margin-bottom: 20px; }
.unit { font-weight: 400; color: var(--muted); }
.disclaimer { border: 2px solid var(--ink); }
.disclaimer p:last-child { margin-bottom: 0; }
.calc-table th { font-weight: 400; }
.calc-table td { text-align: right; font-weight: 600; white-space: nowrap; }
.calc-table tr.net th, .calc-table tr.net td { font-weight: 700; font-size: 19px; border-top: 2px solid var(--ink); }
.net-loss td, .net-loss th { color: var(--danger); }
.net-gain td, .net-gain th { color: var(--accent-dark); }

.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.search-row input { flex: 1 1 240px; min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid #6B7688; border-radius: 8px; font: inherit; color: var(--ink); background: #FFFFFF; }
.search-row input:focus { outline: 3px solid #7FB8A4; outline-offset: 2px; }
.wrap-any { overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.action-row form { margin: 0; }
.danger-zone { border-color: var(--danger); }
.button-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.button-danger:hover { background: #7A1414; border-color: #7A1414; color: #FFFFFF; }
h1 .muted { font-weight: 400; }

@media (max-width: 480px) {
  .lesson-state { display: none; }
  .lesson-row, .lesson-list h2 { padding-left: 18px; padding-right: 18px; }
}

/* ---- Stage four: funnel pages, leads, rich text ---- */
h3 { font-size: 17px; line-height: 1.3; margin: 20px 0 8px; }
code { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 0.9em; background: var(--ground); padding: 1px 5px; border-radius: 4px; }
.center { text-align: center; }
.funnel { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 8px; }
.funnel-copy h1 { font-size: 38px; }
.funnel-copy .invited { margin-bottom: 16px; }
.funnel-direct { grid-template-columns: minmax(0, 720px); justify-content: center; }
.funnel-form { position: sticky; top: 20px; }
.consent { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.free-note { font-size: 15px; background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; }
.rich { overflow-wrap: anywhere; }
.rich h2 { font-size: 22px; margin: 24px 0 8px; }
.rich h3 { font-size: 19px; margin: 20px 0 8px; }
.rich h4 { font-size: 17px; margin: 18px 0 6px; }
.rich ul, .rich ol, ol.tight { margin: 0 0 14px; padding-left: 24px; }
.rich li { margin-bottom: 4px; }
.rich > :first-child { margin-top: 0; }
.shot { margin: 8px 0 18px; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.handoff-frame, .handoff-form { display: none; }
.warning { background: #FFF6E5; border: 1px solid #C9831B; border-radius: 8px; padding: 10px 14px; margin-top: 18px; font-size: 15px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; cursor: pointer; }
.choice input { width: 20px; height: 20px; margin-top: 3px; flex-shrink: 0; }
.choice .muted { font-size: 15px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-label { margin: 14px 0 6px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.upload-row input[type=file] { flex: 1 1 240px; border: 1px dashed #6B7688; border-radius: 8px; padding: 10px 12px; background: var(--ground); font: inherit; font-size: 15px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.shot-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.shot-item img { display: block; width: 100%; height: 140px; object-fit: cover; object-position: top; border-radius: 4px; margin-bottom: 8px; background: var(--ground); }
.shot-item .copy-input { font-size: 13px; }
.field label.check-inline, .check-inline { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 8px; min-height: 44px; }
.field .check-inline input { width: 20px; height: 20px; min-height: 0; }
.reset-form { margin-top: 10px; }
@media (max-width: 760px) {
  .funnel { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .funnel-copy h1 { font-size: 30px; }
  .funnel-form { position: static; }
}
.choice input, .check-inline input, .check input { accent-color: var(--accent); }
