/* Villa Response Readiness Funnel — design system (FINAL TZ §23)
   Warm editorial minimalism · premium hospitality · one restrained accent. */

:root {
  --ink: #17241f;        /* deep palm/ink */
  --ink-soft: #35423d;
  --paper: #faf6ee;      /* warm limestone */
  --surface: #f1ead9;    /* muted sand */
  --muted: #59635e;
  --line: rgba(23, 36, 31, .14);
  --accent: #1f6b5b;     /* deep teal */
  --accent-ink: #f4efe2;
  --success: #2e7d4f;
  --warning: #a3742a;
  --danger: #a3402e;
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 44px rgba(23, 36, 31, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 660px; margin: 0 auto; padding: 0 20px; }
.result-wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 550; letter-spacing: -.01em; line-height: 1.12; }
h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin-bottom: 16px; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 620px; }
.small { font-size: .84rem; color: var(--muted); }
.section { padding: 84px 0; }
.section-alt { background: var(--surface); }

/* Reveal (landing only, subtle) */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
}

/* Header */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,246,238,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-in { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 20px; }
.wordmark { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.wordmark b { color: var(--accent); font-weight: 600; }
.site-nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.site-nav a { text-decoration: none; font-size: .86rem; font-weight: 600; color: rgba(23,36,31,.7); }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .site-nav a:not(.btn) { display: none; } }

/* Buttons — min 48px targets */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: .95rem; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 26px rgba(31,107,91,.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(31,107,91,.36); }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid rgba(23,36,31,.3); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: 0 10px 26px rgba(23, 36, 31, .06);
  min-width: 0; overflow: visible;
}
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { font-size: .9rem; color: var(--ink-soft); }
.card .num {
  width: 38px; height: 38px; border-radius: 11px; margin-bottom: 14px;
  background: rgba(31,107,91,.1); border: 1px solid rgba(31,107,91,.22);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); color: var(--accent); font-size: 1rem;
}
@media (max-width: 860px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* Quiz */
.quiz-shell { max-width: 620px; margin: 0 auto; padding: 28px 20px 120px; }
.progress { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 30px; }
.progress-bar > i { display: block; height: 100%; background: var(--accent); transition: width .35s ease; }
@media (prefers-reduced-motion: reduce) { .progress-bar > i { transition: none; } }

.q-title { font-family: var(--serif); font-size: clamp(1.4rem, 4.4vw, 1.9rem); margin-bottom: 10px; outline: none; }
.q-helper { font-size: .9rem; color: var(--muted); margin-bottom: 22px; }

fieldset { border: 0; }
legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  font-size: .98rem; min-height: 52px; transition: border-color .15s ease, background .15s ease;
}
.opt:hover { border-color: rgba(31,107,91,.5); }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.opt.selected { border-color: var(--accent); background: rgba(31,107,91,.06); }

label.fld { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
}
input.invalid, select.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 6px; }

.q-nav { display: flex; gap: 12px; margin-top: 26px; align-items: center; }
.q-nav .btn-back { background: none; border: 0; color: var(--muted); font-weight: 600; cursor: pointer; min-height: 48px; padding: 0 10px; font-size: .9rem; }
.q-nav .btn-back:hover { color: var(--ink); }

.form-alert {
  border: 1.5px solid var(--danger); background: rgba(163,64,46,.06);
  border-radius: 12px; padding: 14px 16px; margin: 18px 0; font-size: .92rem; color: var(--ink);
}
.form-alert.info { border-color: var(--warning); background: rgba(163,116,42,.07); }
.hidden { display: none !important; }

/* Honeypot — visually hidden but focusable by bots */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }

/* Result */
.score-hero { text-align: center; padding: 58px 0 28px; }
.score-num { font-family: var(--serif); font-size: clamp(3.6rem, 12vw, 5.6rem); line-height: 1; }
.score-num small { font-size: .34em; color: var(--muted); }
.score-explainer {
  max-width: 680px; margin: 18px auto 0; color: var(--ink-soft);
  font-size: .98rem;
}
.result-summary {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 18px; align-items: stretch; margin: 26px 0 32px;
}
.summary-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow); min-width: 0; overflow: visible;
}
.summary-card h2 { font-size: 1.35rem; margin-bottom: 10px; }
.summary-card p { color: var(--ink-soft); font-size: .95rem; margin-top: 8px; }
.summary-list { list-style: none; margin-top: 10px; }
.summary-list li {
  display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(23,36,31,.08);
  color: var(--ink-soft); font-size: .94rem;
}
.summary-list li:last-child { border-bottom: 0; }
.summary-list i { flex: none; font-style: normal; color: var(--accent); font-weight: 700; }
.risk-label {
  display: inline-block; margin-top: 12px; padding: 8px 18px; border-radius: 999px;
  font-weight: 700; font-size: .9rem;
}
.risk-low { background: rgba(46,125,79,.12); color: var(--success); }
.risk-medium { background: rgba(163,116,42,.13); color: var(--warning); }
.risk-medium_high { background: rgba(163,116,42,.2); color: #7c5a1e; }
.risk-high { background: rgba(163,64,46,.13); color: var(--danger); }

.catbars {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 24px; box-shadow: 0 12px 30px rgba(23,36,31,.07);
  min-width: 0; overflow: visible;
}
.catbar { margin-bottom: 16px; }
.catbar .row { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 6px; }
.catbar .row b { font-weight: 700; }
.catbar .track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.catbar .fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .8s ease; }
.catbar.weak .fill { background: var(--warning); }
@media (prefers-reduced-motion: reduce) { .catbar .fill { transition: none; } }

.areas-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; margin: 28px 0; }
.area-stack { min-width: 0; overflow: visible; }
.area-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 12px; box-shadow: 0 8px 22px rgba(23,36,31,.05); min-width: 0; overflow: visible; }
.area-card h3 { font-size: 1rem; margin-bottom: 6px; }
.area-card p { font-size: .9rem; color: var(--ink-soft); }
.area-card.strong { border-left: 4px solid var(--success); }
.area-card.risk { border-left: 4px solid var(--warning); }

.disclaimer {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 18px 20px; font-size: .88rem; color: rgba(23,36,31,.75); margin: 30px 0;
}

.gate-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px; box-shadow: var(--shadow); margin: 30px 0; overflow: visible; }
.gate-panel h2 { font-size: 1.4rem; }
.gate-panel .body { margin: 12px 0 20px; color: var(--ink-soft); font-size: .96rem; }
.profile-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px;
}
.profile-tab {
  border: 1px solid rgba(31,107,91,.22); background: rgba(31,107,91,.07);
  color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: .82rem; font-weight: 700;
}

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(23,36,31,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal { background: var(--paper); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 28px 26px; box-shadow: var(--shadow); }
.modal h2 { font-size: 1.25rem; margin-bottom: 14px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; font-size: .92rem; }
.check-row input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }

.result-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 60px; }

@media (max-width: 860px) {
  .result-summary, .areas-grid { grid-template-columns: 1fr; }
  .catbars { margin-top: 4px; }
}

/* Footer */
footer.site { border-top: 1px solid var(--line); padding: 40px 0 56px; background: var(--surface); }
.footer-in { max-width: 1040px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; font-size: .84rem; color: var(--muted); }
footer.site a { color: rgba(23,36,31,.72); }

/* Prose (privacy) */
.prose { max-width: 720px; margin: 0 auto; padding: 40px 20px 90px; }
.prose h1 { margin-bottom: 20px; }
.prose h2 { font-size: 1.2rem; margin: 30px 0 10px; }
.prose p, .prose li { font-size: .95rem; color: rgba(23,36,31,.8); margin-bottom: 10px; }
.prose ul { padding-left: 22px; }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[aria-live] { min-height: 1px; }
