/*
  Villa Tours — single stylesheet (SPEC §11).
  Mobile-first, max-width 960px, system font stack, one accent (deep teal), amber only for test banners.

  REUSABLE CLASSES (use these in every view; do not add page-specific CSS elsewhere)
  --------------------------------------------------------------------------------
  Layout
    .container            centred column, max-width 960px, side padding
    .hero                 landing hero block: big h1 + .sub paragraph + .actions row
    .grid-2 / .grid-3     responsive card grids (1 col on phones, 2/3 cols from 640px/800px)
    .right                text-align right (numbers in tables)
    .muted                secondary grey text (hints, drafts notes, timestamps)
    .section              vertical spacing block with optional h2
  Buttons
    .btn                  base button / link-as-button (use on <a> or <button>)
    .btn-primary          teal filled (main action: 'Place card hold', 'Approve')
    .btn-secondary        outlined teal (secondary actions)
    .btn-danger           red outlined → filled on hover (cancel, delete)
    .btn-sm               compact variant for table rows
    .btn[disabled]        greyed, no pointer
  Cards
    .card                 white panel with border, radius, padding; .card h2/h3 tight on top
    .card-title           small uppercase label at the top of a card
  Tables
    .table-wrap           horizontal scroll container (wrap every .table in one)
    .table                full-width table, zebra rows, header in muted uppercase
  Badges (order status)
    .badge                pill; add ONE of:
    .badge-draft .badge-hold .badge-needs_info .badge-approved .badge-delivered
    .badge-cancelled .badge-expired
  Forms
    .form-field           block with <label>, then input/select/textarea, then .hint and/or .error
    .form-field .hint     grey help text under the control
    .form-field .error    red validation message (also sets the control's border red via .has-error)
    .form-field.has-error add to the wrapper when the field failed validation
    .checkbox-row         label with a checkbox on the left and text on the right
    .form-actions         row for submit buttons (wraps on phones)
    .fieldset             grouped fields with a legend (plain <fieldset class="fieldset">)
  Messages
    .banner-test          amber full-width test-mode banner (head.ejs renders it; mock checkout can too)
    .flash                blue info strip at the top of a page; .flash-ok green; .flash-warn amber;
                          .flash-error red
  Pricing
    .price-table          table of tiers; .price-old = struck-through full price; .price-new = founding
    .founding-banner      teal strip 'Founding price for the first N orders — x left'
  Content
    .steps                ordered list rendered as numbered steps (How it works)
    .faq                  <details class="faq"><summary>Q</summary><p>A</p></details>
    .proof                two-up Photo / Model images (landing); .proof figure + figcaption
    .quote-lines          dl of quote lines; .quote-total the bold last row
    .kv                   definition list of key → value pairs (order details)
    .prose                long-form text pages (terms, privacy): comfortable measure and spacing
    .page-title           h1 with a .muted subtitle under it
*/

:root {
  --teal: #0f5c5c;
  --teal-dark: #0a4343;
  --teal-soft: #e6f0f0;
  --amber: #b45309;
  --amber-soft: #fff4e5;
  --amber-border: #f0c48a;
  --red: #b42318;
  --red-soft: #fdecea;
  --green: #1f7a4d;
  --green-soft: #e8f5ee;
  --blue: #1d4ed8;
  --blue-soft: #e8eefc;
  --ink: #1b2422;
  --ink-2: #4b5755;
  --muted: #6b7673;
  --line: #dfe5e3;
  --bg: #f6f8f7;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 30, 0.06), 0 4px 16px rgba(16, 32, 30, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
img, svg { max-width: 100%; height: auto; display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--teal-soft); padding: 0.05em 0.35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
:focus-visible { outline: 3px solid rgba(15, 92, 92, 0.45); outline-offset: 2px; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 2rem 0; }
.section h2 { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.right { text-align: right; }
.small { font-size: 0.9rem; }

@media (min-width: 640px) {
  h1 { font-size: 2.4rem; }
  .container { padding: 0 1.5rem; }
  .section { padding: 3rem 0; }
}

/* ---------- header / nav ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--teal); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 0.25rem 1rem; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 0.35rem 0; }
.nav a:hover { color: var(--teal); }
.nav form { margin: 0; display: inline; }
.nav .btn { padding: 0.45rem 0.9rem; }
.nav a.btn-primary { color: #fff; }           /* .nav a would otherwise out-rank .btn-primary's white text */
.nav a.btn-secondary { color: var(--teal); }
.link-button { background: none; border: 0; padding: 0.35rem 0; font: inherit; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.link-button:hover { color: var(--teal); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-footer a { color: var(--ink-2); }

/* ---------- banners & flash ---------- */
.banner-test {
  background: var(--amber-soft);
  color: var(--amber);
  border-bottom: 1px solid var(--amber-border);
  font-weight: 600;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
}
.flash {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(29, 78, 216, 0.25);
}
.flash-ok { background: var(--green-soft); color: var(--green); border-color: rgba(31, 122, 77, 0.3); }
.flash-warn { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.flash-error { background: var(--red-soft); color: var(--red); border-color: rgba(180, 35, 24, 0.3); }

/* ---------- hero ---------- */
.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { max-width: 20ch; }
.hero .sub { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .hero { padding: 4rem 0 2rem; } .hero .sub { font-size: 1.2rem; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.25rem; border-radius: 8px; font: inherit; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent; line-height: 1.2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-secondary { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-secondary:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 0.5rem; }
.grid-2, .grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 800px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 480px; }
.table th, .table td { padding: 0.65rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; background: var(--bg); white-space: nowrap; }
.table tbody tr:nth-child(even) { background: #fbfcfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; font-variant-numeric: tabular-nums; }
.table a { font-weight: 500; }

/* ---------- badges (order status) ---------- */
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; background: var(--teal-soft); color: var(--teal); border: 1px solid transparent; }
.badge-draft { background: #eef0f0; color: var(--ink-2); }
.badge-hold { background: var(--blue-soft); color: var(--blue); }
.badge-needs_info { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.badge-approved { background: var(--teal-soft); color: var(--teal); }
.badge-delivered { background: var(--green-soft); color: var(--green); }
.badge-cancelled { background: var(--red-soft); color: var(--red); }
.badge-expired { background: #f1f1f1; color: var(--muted); text-decoration: line-through; }
.urgent { color: var(--red); font-weight: 600; }

/* ---------- forms ---------- */
.form-field { margin-bottom: 1.25rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-field input[type="text"], .form-field input[type="email"], .form-field input[type="tel"],
.form-field input[type="number"], .form-field input[type="password"], .form-field input[type="file"],
.form-field select, .form-field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid #c9d2cf; border-radius: 8px; padding: 0.6rem 0.75rem;
}
.form-field input[type="file"] { padding: 0.45rem 0.6rem; }
.form-field textarea { min-height: 6rem; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--teal); outline: 3px solid rgba(15, 92, 92, 0.2); outline-offset: 0; }
.form-field .hint { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.35rem; }
.form-field .error { display: block; color: var(--red); font-size: 0.9rem; font-weight: 500; margin-top: 0.35rem; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: var(--red); }
.form-field .required::after { content: " *"; color: var(--red); }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 1rem; font-weight: 400; cursor: pointer; }
.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; flex: none; accent-color: var(--teal); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 0.25rem; margin: 0 0 1.5rem; background: var(--card); }
.fieldset legend { font-weight: 650; padding: 0 0.4rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- pricing ---------- */
.price-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.price-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg); }
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table .right { text-align: right; font-variant-numeric: tabular-nums; }
.price-old { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-right: 0.5rem; }
.price-new { color: var(--teal); font-weight: 700; }
.founding-banner { background: var(--teal); color: #fff; border-radius: var(--radius); padding: 0.8rem 1rem; font-weight: 600; margin-bottom: 1rem; }
.quote-lines { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; }
.quote-lines dt { margin: 0; color: var(--ink-2); }
.quote-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.quote-lines .quote-total { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 0.5rem; margin-top: 0.25rem; }
.quote-lines .negative { color: var(--green); }

/* ---------- content blocks ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps li strong { display: block; margin-bottom: 0.15rem; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(4, 1fr); } .steps li { padding-left: 0; padding-top: 2.8rem; } }

.faq { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal); font-weight: 400; }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 0.6rem 0 0; color: var(--ink-2); }

.proof { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.proof figure { margin: 0; }
.proof img, .proof svg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.proof figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: var(--muted); }
@media (min-width: 640px) { .proof { grid-template-columns: 1fr 1fr; } }

.kv { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0.25rem 1.5rem; }
.kv dt { color: var(--muted); font-size: 0.85rem; }
.kv dd { margin: 0 0 0.6rem; overflow-wrap: anywhere; }
@media (min-width: 640px) { .kv { grid-template-columns: max-content 1fr; } .kv dd { margin-bottom: 0.4rem; } }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.page-title { padding-top: 2rem; margin-bottom: 1.5rem; }
.page-title h1 { margin-bottom: 0.25rem; }

/* ---------- error page ---------- */
.error-page { padding: 4rem 0; text-align: center; }
.error-page .status { font-size: 3.5rem; font-weight: 700; color: var(--teal); line-height: 1; margin-bottom: 0.5rem; }
.error-page .ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media print {
  .site-header, .site-footer, .banner-test, .btn { display: none !important; }
  body { background: #fff; }
}
