/* ============================================================
   HostTally — Design System
   Brand: warm terracotta / deep charcoal, hospitality-professional
   ============================================================ */

:root {
  --charcoal: #2b2420;
  --charcoal-dark: #1a1512;
  --terracotta: #c1613b;
  --terracotta-light: #e08a5b;
  --terracotta-dark: #9c4527; /* used anywhere terracotta sits behind/as text — passes WCAG AA (6.4:1 on white) */
  --bg: #faf7f4;
  --bg-card: #ffffff;
  --border: #e7ddd3;
  --text: #2b2420;
  --text-muted: #6b6058;
  --warning-bg: #fff7ed;
  --warning-border: #f4d9b0;
  --profit: #2e7d43;       /* green — at or above breakeven */
  --profit-soft: #e5f3e9;
  --loss: #c0392b;         /* red — below breakeven */
  --loss-soft: #fdeceb;
  --radius: 10px;
  --max-width: 1120px;
  --shadow: 0 2px 10px rgba(43, 36, 32, 0.07);
  --shadow-lg: 0 8px 30px rgba(43, 36, 32, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

a { color: var(--terracotta-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */
.site-header { background: var(--charcoal); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: var(--max-width); margin: 0 auto; }
.logo { color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.logo span { color: var(--terracotta-light); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: #e8dfd6; font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: #fff; font-weight: 700; border-bottom: 2px solid var(--terracotta-dark); padding-bottom: 3px; }
.nav-cta { background: var(--terracotta-dark); color: #fff !important; padding: 8px 18px; border-radius: 6px; font-weight: 600; }
.nav-cta:hover { background: #7d3720; text-decoration: none; }

/* ---------- Promo bar (toolkit) ---------- */
.promo-bar { display: block; background: var(--terracotta-dark); color: #fff; text-align: center; padding: 9px 16px; font-size: 0.9rem; }
.promo-bar:hover { background: #7d3720; text-decoration: none; }
.promo-bar strong { color: #fff; }
.promo-bar-tag { background: rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 2px 10px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 8px; }
.promo-bar-arrow { margin-left: 6px; font-weight: 700; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, rgba(43, 36, 32, 0.88) 0%, rgba(26, 21, 18, 0.92) 100%), url('../images/hero.jpg') center / cover no-repeat; color: #fff; padding: 64px 0 80px; text-align: center; }
.eyebrow { display: inline-block; background: rgba(224, 138, 91, 0.18); color: var(--terracotta-light); padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 18px; }
.hero h1 { font-size: 2.6rem; line-height: 1.15; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.02em; }
.hero p.lead { font-size: 1.15rem; color: #d8cec4; max-width: 640px; margin: 0 auto 8px; }
.trust-row { margin-top: 28px; display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; color: #b3a89d; font-size: 0.88rem; }
.trust-row span { display: flex; align-items: center; gap: 6px; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
section.alt { background: #f2ece5; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head h2 { font-size: 2rem; margin: 0 0 12px; color: var(--charcoal); font-weight: 800; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Calculator Card ---------- */
.calc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 36px; max-width: 820px; margin: -56px auto 0; position: relative; z-index: 5; }
.calc-section-title { font-weight: 800; color: var(--charcoal); font-size: 1.05rem; margin: 24px 0 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.calc-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.calc-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.field { margin-bottom: 4px; display: flex; flex-direction: column; height: 100%; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--charcoal); }
.field input, .field select { width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 1rem; font-family: inherit; background: #fdfbf9; transition: border-color 0.15s; }
.field input:focus, .field select:focus { outline: none; border-color: var(--terracotta-light); }
.field .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; flex: 1; }

.btn { display: inline-block; background: var(--terracotta-dark); color: #fff; border: none; padding: 14px 28px; border-radius: 7px; font-size: 1rem; font-weight: 700; cursor: pointer; width: 100%; transition: background 0.15s, transform 0.1s; margin-top: 20px; }
.btn:hover { background: #7d3720; }
.btn:active { transform: scale(0.99); }
.btn-secondary { background: transparent; border: 1.5px solid var(--charcoal); color: var(--charcoal); }
.btn-secondary:hover { background: var(--charcoal); color: #fff; }

.result-box { margin-top: 24px; padding: 24px; border-radius: var(--radius); background: #fdf3ec; border: 1.5px solid #f0d5bf; display: none; }
.result-box.show { display: block; }
.result-headline { font-size: 1.05rem; color: var(--charcoal); margin: 0 0 16px; padding-bottom: 16px; border-bottom: 1px dashed #e8c9ab; font-weight: 600; }
.result-headline strong { color: var(--terracotta-dark); }
.result-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0dfcd; font-size: 0.95rem; }
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-muted); }
.result-row .value { font-weight: 700; color: var(--charcoal); }
.result-row.total .value { color: var(--terracotta); font-size: 1.3rem; }
.disclaimer-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }

/* ---------- Live result visuals ---------- */
.tone-profit { color: var(--profit); }
.tone-loss { color: var(--loss); }

.viz-section { margin: 0 0 22px; padding: 16px 18px; background: #fff; border: 1px solid #f0dfcd; border-radius: 8px; }
.viz-title { font-weight: 800; font-size: 0.92rem; color: var(--charcoal); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.viz-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--profit); display: inline-block; animation: vizPulse 2s ease-in-out infinite; }
@keyframes vizPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
.viz-legend { font-size: 0.76rem; color: var(--text-muted); margin: -4px 0 12px; display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend-swatch.legend-profit { background: var(--profit); margin-left: 10px; }
.legend-swatch.legend-profit:first-child { margin-left: 0; }
.legend-swatch.legend-loss { background: var(--loss); }

/* Seasonal profit bars */
.season-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.season-bar-row:last-child { margin-bottom: 0; }
.season-bar-name { width: 42px; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.season-bar-track { flex: 1; height: 26px; background: #f6f0e9; border-radius: 6px; overflow: hidden; }
.season-bar-fill { height: 100%; width: 0; border-radius: 6px; transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s; }
.season-bar-fill.is-profit { background: linear-gradient(90deg, #3d9457, var(--profit)); }
.season-bar-fill.is-loss { background: linear-gradient(90deg, #d95445, var(--loss)); }
.season-bar-value { width: 110px; font-size: 0.88rem; font-weight: 800; flex-shrink: 0; }
.season-bar-value.is-profit { color: var(--profit); }
.season-bar-value.is-loss { color: var(--loss); }

/* Breakeven gauges (circular) */
.gauge-group { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.gauge-block { text-align: center; }
.gauge-svg { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.gauge-track { stroke: #f0e3d4; }
.gauge-arc { transition: stroke-dasharray 0.45s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s; }
.gauge-arc.is-profit { stroke: var(--profit); }
.gauge-arc.is-loss { stroke: var(--loss); }
.gauge-tick { stroke: var(--charcoal); transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.gauge-num { font-weight: 800; fill: var(--charcoal); font-size: 24px; font-family: inherit; }
.gauge-sub { fill: var(--text-muted); font-size: 10.5px; font-family: inherit; }
.gauge-season { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--terracotta-dark); margin-top: 8px; }
.gauge-verdict { font-size: 0.84rem; font-weight: 700; margin-top: 2px; }
.gauge-verdict.is-profit { color: var(--profit); }
.gauge-verdict.is-loss { color: var(--loss); }

/* ---------- Cockpit layout: form left, live sticky results right ---------- */
.calc-cockpit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: -56px; position: relative; z-index: 5; }
.calc-cockpit .calc-card { margin: 0; max-width: none; }
.cockpit-results { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: thin; border-radius: var(--radius); }
.cockpit-results .result-box { margin-top: 0; }
.cockpit-results .pro-teaser { margin-top: 16px; }
.hero-profit { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px dashed #e8c9ab; }
.hero-profit-label { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.hero-profit-value { font-size: 2.1rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; transition: color 0.3s; }
.hero-profit-value.is-profit { color: var(--profit); }
.hero-profit-value.is-loss { color: var(--loss); }
.hero-profit-sub { font-size: 0.86rem; color: var(--text-muted); }

/* Dual input: slider under each numeric field (injected by JS) */
.field-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 999px; background: #eaddcf; outline: none; margin: 10px 0 2px; cursor: pointer; }
.field-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--terracotta-dark); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(43, 36, 32, 0.35); cursor: grab; }
.field-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--terracotta-dark); border: 2.5px solid #fff; cursor: grab; }
.field-slider:focus-visible { box-shadow: 0 0 0 3px rgba(224, 138, 91, 0.35); }

/* Mobile sticky mini-bar (results summary while scrolling the form) */
.mini-bar { display: none; }

/* Cumulative year chart */
.chart-cumulative { width: 100%; height: auto; display: block; }
.cum-axis { stroke: var(--charcoal); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: 0.5; }
.cum-bar { transition: y 0.3s, height 0.3s; }
.cum-bar-profit { fill: var(--profit); }
.cum-bar-loss { fill: var(--loss); }
.cum-label { font-size: 10px; fill: var(--text-muted); text-anchor: middle; font-family: inherit; }
.chart-cumulative-note { font-size: 0.86rem; color: var(--text); margin-top: 8px; }

/* ---------- Breakeven insight block ---------- */
.insight-block { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #e8c9ab; }
.insight-title { font-weight: 800; color: var(--charcoal); font-size: 0.98rem; margin-bottom: 12px; }
.insight-season { margin-bottom: 12px; }
.insight-season:last-child { margin-bottom: 0; }
.insight-season-label { font-weight: 700; color: var(--terracotta-dark); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px; }
.insight-season div:not(.insight-season-label) { font-size: 0.92rem; color: var(--text); line-height: 1.55; }
.insight-positive { color: #2f6b3a; font-weight: 600; }

/* ---------- Post-result toolkit CTA ---------- */
.result-cta { display: flex; gap: 18px; align-items: center; margin-top: 20px; padding: 18px 20px; background: #fff; border: 1.5px solid var(--terracotta-light); border-radius: 8px; }
.result-cta-cover { width: 86px; height: auto; border-radius: 6px; box-shadow: var(--shadow); flex-shrink: 0; }
.result-cta-title { font-weight: 800; color: var(--charcoal); margin-bottom: 6px; }
.result-cta p { margin: 0 0 12px; font-size: 0.92rem; color: var(--text); }
.result-cta .btn { width: auto; margin-top: 0; padding: 11px 22px; font-size: 0.92rem; }

/* ---------- Pro teaser ---------- */
.pro-teaser { margin-top: 24px; background: var(--charcoal); color: #e8dfd6; border-radius: var(--radius); padding: 24px 28px; text-align: center; }
.pro-teaser-badge { display: inline-block; background: rgba(224, 138, 91, 0.18); color: var(--terracotta-light); padding: 5px 14px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
.pro-teaser p { margin: 0 0 14px; font-size: 0.95rem; color: #d8cec4; }
.pro-teaser strong { color: #fff; }
.btn-secondary-link { display: inline-block; color: var(--terracotta-light); font-weight: 700; font-size: 0.92rem; }
.btn-secondary-link:hover { color: #fff; }

/* ---------- Cards grid ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card .icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(193, 97, 59, 0.1); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 1.4rem; }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--charcoal); }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Comparison table ---------- */
.compare-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.compare-table th, .compare-table td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.compare-table th { background: var(--charcoal); color: #fff; font-weight: 700; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:nth-child(even) td { background: #faf6f2; }
.badge { display: inline-block; background: var(--terracotta-dark); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }

/* ---------- FAQ ---------- */
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-question { padding: 18px 22px; font-weight: 700; color: var(--charcoal); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-question::after { content: "+"; font-size: 1.4rem; color: var(--terracotta); font-weight: 400; transition: transform 0.2s; }
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; padding: 0 22px; color: var(--text-muted); }
.faq-item.open .faq-answer { max-height: 400px; padding: 0 22px 20px; }

/* ---------- Email capture ---------- */
.capture-box { background: var(--charcoal); color: #fff; border-radius: var(--radius); padding: 44px; text-align: center; }
.capture-box h2 { margin: 0 0 10px; font-size: 1.6rem; }
.capture-box p { color: #d8cec4; margin: 0 0 24px; }
.capture-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.capture-form input { flex: 1; min-width: 220px; padding: 13px 16px; border-radius: 7px; border: none; font-size: 1rem; }
.capture-form .btn { width: auto; padding: 13px 24px; margin-top: 0; }

/* ---------- Ebook promo ---------- */
.ebook-box { display: flex; gap: 32px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.ebook-cover { flex-shrink: 0; width: 140px; height: 180px; background: linear-gradient(160deg, var(--terracotta) 0%, var(--terracotta-light) 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; text-align: center; padding: 16px; font-size: 0.95rem; box-shadow: var(--shadow-lg); }
.ebook-price { font-size: 1.8rem; font-weight: 800; color: var(--terracotta); margin: 12px 0; }
.ebook-cover-img { width: 200px; height: auto; border-radius: 8px; box-shadow: var(--shadow-lg); flex-shrink: 0; }

/* ---------- Article / guide content ---------- */
.article { max-width: 760px; margin: 0 auto; background: #fff; padding: 48px; border-radius: var(--radius); box-shadow: var(--shadow); }
.article-hero { width: 100%; height: auto; display: block; border-radius: var(--radius); margin: 0 0 28px; }
.article h1 { color: var(--charcoal); font-size: 2.1rem; margin-top: 0; }
.article h2 { color: var(--charcoal); font-size: 1.4rem; margin-top: 36px; }
.article h3 { color: var(--charcoal); font-size: 1.15rem; }
.article p, .article li { color: var(--text); font-size: 1.02rem; }
.article table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.article th, .article td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; font-size: 0.92rem; }
.article th { background: #f2ece5; }
.callout { background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: 8px; padding: 16px 20px; font-size: 0.92rem; margin: 24px 0; }
.callout strong { color: #92400e; }
.byline { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.byline .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--terracotta); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); padding: 16px 0; }
.breadcrumbs a { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal-dark); color: #b3a89d; padding: 48px 0 24px; font-size: 0.9rem; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin: 0 0 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: #b3a89d; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #3a322c; padding-top: 20px; text-align: center; font-size: 0.82rem; color: #8a7f74; }

/* ---------- FAQ (homepage) ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-list .faq-item { background: transparent; border: none; border-radius: 0; overflow: visible; margin-bottom: 0; padding: 22px 0; border-bottom: 1px solid rgba(0,0,0,0.08); }
.faq-list .faq-item:last-child { border-bottom: none; }
.faq-list .faq-item h3 { margin: 0 0 10px; font-size: 1.1rem; }
.faq-list .faq-item p { margin: 0; color: var(--text-muted); line-height: 1.65; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .calc-cockpit { grid-template-columns: 1fr; }
  .cockpit-results { position: static; max-height: none; overflow: visible; }
  .mini-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--charcoal); color: #e8dfd6; padding: 11px 18px; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.88rem; box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.22); transition: transform 0.3s ease; text-decoration: none; }
  .mini-bar:hover { text-decoration: none; }
  .mini-bar.hidden { transform: translateY(110%); }
  .mini-bar-value { font-weight: 800; font-size: 1.05rem; }
  .mini-bar-value.is-profit { color: #7fd39a; }
  .mini-bar-value.is-loss { color: #ff9d8f; }
  .mini-bar-link { color: var(--terracotta-light); font-weight: 700; white-space: nowrap; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 2rem; }
  .calc-grid, .calc-grid.three { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article { padding: 28px; }
  .compare-table { display: block; overflow-x: auto; }
  .ebook-box { flex-direction: column; text-align: center; }
  .result-cta { flex-direction: column; text-align: center; }
  .gauge-group { grid-template-columns: 1fr 1fr; }
  .season-bar-value { width: 92px; font-size: 0.8rem; }
}

