@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Toolbox design tokens (see toolbox.css) — this page keeps a navy
     header + two-column layout instead of the toolbox's sidebar, since
     it's a standalone guest-facing tool rather than an internal-suite app.
     Font is Montserrat here rather than toolbox's Inter, per request. */
  --navy: #2b3252;
  --navy-2: #3a4161;
  --navy-3: #474e6e;
  --green: #74cf29;
  --green-d: #61bf14;
  --red: #ff5757;
  --amber: #ffce49;
  --ink: #1b2735;
  --muted: #6b7a8d;
  --line: #e3e9f0;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,36,59,.06), 0 6px 18px rgba(16,36,59,.06);

  /* Location colors, carried over from the toolbox for anywhere a single
     Lodge location needs representing. */
  --factory52: #79cd46;
  --lunken: #ff7040;
  --northshore: #73c0d2;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 2.75rem 1.5rem 2.25rem;
  text-align: center;
}

.header-logo {
  display: block;
  margin: 0 auto 1rem;
  width: 280px;
  height: auto;
}

.eyebrow {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--green);
  margin-bottom: 0.6rem;
}

.hero-title {
  font-weight: 800;
  font-size: clamp(2rem, 5.4vw, 3.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  line-height: 1.08;
}

.hero-title-green {
  color: var(--green);
}

.hero-sub {
  max-width: 42rem;
  margin: 0.9rem auto 0;
  color: #C9D3DE;
  font-size: 1.02rem;
}

.hero-sub:first-of-type {
  margin-top: 0.5rem;
}

.hero-sub-cta {
  font-weight: 700;
  color: #fff;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

/* The calculator row: inputs on the left, results + join on the right.
   align-items: stretch makes both columns the same height (the taller
   of the two), so the input panel's bottom edge lines up with the
   bottom of the Ready To Join panel. */
.calc-row {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 860px) {
  .calc-row { grid-template-columns: 1fr; }
}

.results-col {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* If the input column is taller, let the Join panel (rather than the
   Results panel above it) absorb the extra height so its bottom edge
   reaches the input column's bottom edge. */
.results-col > .join-panel {
  flex: 1;
}

/* Good To Know spans the full width below the calculator row. */
main > .notes-panel {
  margin-top: 1.5rem;
}

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

.panel + .panel { margin-top: 1.5rem; }

.panel-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.95rem;
  color: var(--navy);
  margin: 0 0 1rem;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.print-btn:hover {
  background: #fff;
  color: var(--green-d);
  border-color: var(--green-d);
}

.print-btn-icon {
  flex-shrink: 0;
}

/* Segmented controls */
.segmented {
  display: flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.segmented button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.6rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
}

.segment-sublabel {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--green);
  margin-top: 0.1rem;
}

.segmented button.is-active .segment-sublabel {
  color: #b6f27e;
}

.segmented button.is-active {
  background: var(--navy);
  color: #fff;
}

.segmented button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Input groups */
.field-group {
  margin-bottom: 1.1rem;
}

.field-group:last-child { margin-bottom: 0; }

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.field-label .field-unit {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}

.field-pair {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.stepper button {
  border: none;
  background: transparent;
  width: 2.1rem;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--navy);
  cursor: pointer;
}

.stepper button:hover { background: rgba(116,207,41,0.14); }

.stepper input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.55rem 0.2rem;
}

.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type=number] { -moz-appearance: textfield; }

.field-hint {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.field-hint-center {
  text-align: center;
}

/* Scoreboard — the single highlighted "results" box per membership tier.
   Solid navy (no gradient), and holds everything about that tier's
   result: label, price, headline, booking-window copy, and savings. */
.scoreboard {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
}

.scoreboard-label {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #fff;
}

.scoreboard-tier {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--tier-color, var(--muted));
  color: var(--tier-text-color, var(--navy));
}

.scoreboard-number {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  margin: 0.6rem 0 0.35rem;
  letter-spacing: -0.01em;
  color: var(--accent-color, #fff);
}

.scoreboard-number span {
  font-size: 1.1rem;
  color: #93A2B3;
  font-weight: 500;
  margin-left: 0.25rem;
}

.scoreboard-booking-window {
  display: inline-block;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid;
  margin-bottom: 0.85rem;
  color: var(--accent-color, #fff);
}

.scoreboard-headline {
  font-weight: 700;
  font-size: 1.15rem;
  max-width: 30rem;
  margin: 0 auto 0.6rem;
  color: var(--accent-color, #fff);
}

.scoreboard-supporting {
  color: #C9D3DE;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 30rem;
  margin: 0 auto;
}

.scoreboard-savings-line {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 0.95rem;
  color: #C9D3DE;
}

.scoreboard-savings-line strong {
  color: var(--green);
}

/* Billing note (Monthly vs. Annually, with the 10% reminder) — only
   needed in print, since the live page already shows the Billing
   toggle. Hidden on screen, shown via the @media print override below. */
.scoreboard-billing-note {
  display: none;
}

/* Bars */
.bars {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 6rem 1fr 4.5rem;
  align-items: center;
  gap: 0.7rem;
}

.bar-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

.bar-row.is-winner .bar-label { color: var(--ink); font-weight: 700; }

.bar-winner-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
}

.bar-track {
  background: var(--bg);
  border-radius: 999px;
  height: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bar-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: right;
  color: var(--navy);
}

.bar-row.is-winner .bar-value { font-weight: 700; }

/* Disclosure buttons */
.disclosure-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--green-d);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  margin-top: 1.25rem;
}

.disclosure-btn:hover { color: var(--navy); }

.disclosure-panel {
  max-height: 0;
  overflow-y: hidden;
  transition: max-height 0.3s ease;
}

.disclosure-panel.is-open {
  max-height: 2000px;
  margin-top: 1rem;
}

/* Tables */
.data-table-wrap {
  overflow-x: auto;
  padding-bottom: 2px; /* keeps a scrollbar, if shown, from clipping the last row's border */
}

table.data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

/* Equal-width tier columns (Non-Member/Friend/Fanatic/Founder) across both
   the cost breakdown and rate card tables — both share the same 5-column
   shape (a label column + 4 tier columns). */
table.data-table th:nth-child(1),
table.data-table td:nth-child(1) {
  width: 26%;
}

table.data-table th:nth-child(n + 2),
table.data-table td:nth-child(n + 2) {
  width: 18.5%;
}

table.data-table th,
table.data-table td {
  padding: 0.6rem 0.5rem;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  border-bottom: 1px solid var(--line);
}

table.data-table th[scope="row"] {
  text-align: left;
  color: var(--navy);
  font-weight: 600;
  white-space: normal;
}

table.data-table tbody tr:hover td { background: #f8fbfe; }

table.data-table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

table.data-table td.is-winner,
table.data-table th.is-winner {
  background: rgba(116,207,41,0.16);
}

table.data-table tbody tr:hover td.is-winner { background: rgba(116,207,41,0.22); }

/* Doubles/Singles Rate cells — two compact day-range lines per cell */
.rate-block {
  margin-bottom: 0.35rem;
}

.rate-block:last-child {
  margin-bottom: 0;
}

.rate-price {
  font-weight: 600;
}

.rate-days {
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--muted);
}

table.data-table tr.total-row th,
table.data-table tr.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--navy);
  border-bottom: none;
}

/* Join panel — always visible, solid navy to match header/footer */
.join-panel {
  background: var(--navy);
}

.join-panel .panel-title {
  color: #fff;
}

.join-intro {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: #C9D3DE;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  align-items: stretch;
}

.location-card {
  background: var(--navy-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.1rem 1rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.location-card-logo {
  width: 160px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 0.25rem;
}

.location-card-address {
  width: 100%;
  color: #93A2B3;
  font-size: 0.76rem;
  line-height: 1.4;
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 2.2em;
}

.location-card-address span {
  display: block;
  text-align: center;
}

.location-card-btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: 2px solid var(--green);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  margin-top: auto;
}

.location-card-btn:hover {
  background: #fff;
  color: var(--green-d);
  border-color: var(--green-d);
}

.join-upgrade-note {
  margin: 1.1rem 0 0;
  font-size: 0.8rem;
  color: #93A2B3;
  line-height: 1.5;
}

.join-upgrade-note a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

.join-upgrade-note a:hover {
  color: var(--green);
}

/* Notes */
.notes-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.notes-panel li { margin-bottom: 0.5rem; }
.notes-panel li:last-child { margin-bottom: 0; }

footer.site-footer {
  background: var(--navy);
  color: #93A2B3;
  padding: 2.5rem 1.25rem 2rem;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr; }
}

.footer-logo-col {
  display: flex;
  justify-content: center;
}

.footer-logo {
  width: 250px;
  height: auto;
}

.footer-fine-print {
  font-size: 0.72rem;
  line-height: 1.65;
}

.footer-fine-print p { margin: 0 0 0.75rem; }
.footer-fine-print p:last-child { margin-bottom: 0; }

.footer-fine-print a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

.footer-fine-print a:hover {
  color: var(--green);
}

.footer-locations {
  max-width: 1080px;
  margin: 1.75rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.8rem;
}

/* ── Print / Save as PDF ─────────────────────────────────────────────
   Printing shows a curated 2-page summary (#print-only), not the whole
   live page. Page 1: results + full cost breakdown. Page 2: Good To
   Know + rate card + QR codes to join at each location. */
#print-only {
  display: none;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #fff;
  }

  body > *:not(#print-only) {
    display: none !important;
  }

  #print-only {
    display: block !important;
  }

  .print-page {
    padding: 0.3in 0.25in;
    font-size: 0.92em; /* tightened slightly so pages 1 & 2 fit */
  }

  .print-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
  }

  .print-page-logo {
    width: 150px;
    height: auto;
  }

  .print-page-heading {
    text-align: right;
  }

  .print-page-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--navy);
  }

  .print-page-date {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.1rem;
  }

  .print-section-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.85rem;
    color: var(--navy);
    margin: 1.1rem 0 0.6rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
  }

  .print-section-title-center {
    text-align: center;
  }

  #print-page-1 .print-section-title:first-of-type {
    border-top: none;
    padding-top: 0;
  }

  /* Scoreboard: white with a navy outline instead of a solid navy block
     — much lighter on home-printer ink. Text falls back to navy (or the
     tier's brand color) instead of the white/light tones used on
     screen. --accent-color-print is set per-tier in app.js. */
  #print-scoreboard {
    background: #fff !important;
    color: var(--navy) !important;
    border: 2px solid var(--navy);
    padding: 1.1rem 1.25rem;
    break-inside: avoid;
  }

  #print-scoreboard .scoreboard-label {
    color: var(--navy) !important;
  }

  #print-scoreboard .scoreboard-number,
  #print-scoreboard .scoreboard-headline,
  #print-scoreboard .scoreboard-booking-window {
    color: var(--accent-color-print, var(--navy)) !important;
  }

  #print-scoreboard .scoreboard-number span {
    color: var(--muted) !important;
  }

  #print-scoreboard .scoreboard-supporting {
    color: var(--ink) !important;
  }

  #print-scoreboard .scoreboard-savings-line {
    color: var(--ink) !important;
    border-top-color: var(--line) !important;
  }

  #print-scoreboard .scoreboard-billing-note {
    display: block;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    max-width: 26rem;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  #print-scoreboard .scoreboard-billing-row {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
  }

  #print-scoreboard .scoreboard-billing-row:last-child {
    margin-bottom: 0;
  }

  #print-scoreboard .scoreboard-billing-row.is-selected {
    color: var(--ink);
    font-weight: 700;
  }

  #print-scoreboard .scoreboard-billing-row strong {
    color: var(--accent-color-print, var(--navy));
  }

  /* Tighten the table typography so Full Cost Breakdown fits on page 1
     and the Full Rate Card fits on page 2. */
  #print-breakdown-table,
  #print-rate-card-table {
    font-size: 0.78rem;
  }

  #print-breakdown-table th,
  #print-breakdown-table td,
  #print-rate-card-table th,
  #print-rate-card-table td {
    padding: 0.4rem 0.4rem;
  }

  /* Match the header's first column to the left-aligned row labels
     beneath it (e.g. "Monthly Cost" over "Membership Fee", "Open Play"...) */
  table.data-table thead th:first-child {
    text-align: left;
  }

  .rate-price {
    font-size: 0.9em;
  }

  .rate-days {
    font-size: 0.62rem;
  }

  #print-page-2,
  #print-page-3 {
    page-break-before: always;
  }

  .notes-panel ul,
  #print-notes-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--muted);
  }

  #print-notes-list li { margin-bottom: 0.5rem; }
  #print-notes-list li:last-child { margin-bottom: 0; }

  .print-qr-intro {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 1rem;
  }

  .print-qr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .print-qr-grid-apps {
    grid-template-columns: repeat(2, 1fr);
    max-width: 22rem;
  }

  .print-qr-card {
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 0.75rem;
    break-inside: avoid;
  }

  .print-qr-name {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }

  .print-qr-address {
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
  }

  .print-qr-image img {
    width: 132px;
    height: 132px;
    image-rendering: pixelated;
  }

  .print-qr-caption {
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--green-d);
  }

  .print-fine-print {
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--muted);
  }

  .print-fine-print p { margin: 0 0 0.6rem; }
  .print-fine-print p:last-child { margin-bottom: 0; }
}
