/* ==========================================================================
   Caloosa Calc — site styles (one file for every page)
   Palette: Gulf Teal (see claude/PROJECT-RULES.md §4). Orange is reserved for
   Rio, the main button and the hero highlight line — never orange text on a
   light background, never red for results.
   Type: Archivo 800–900 (headings, numbers) · Inter 400–700 (body, UI).
   Phone first: base styles are for phones, @media (min-width) adds desktop.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --teal-deep: #0B3D3F;      /* header, hero, dark buttons, selected states */
  --teal-footer: #072B2D;
  --teal-accent: #0B6E6A;    /* links, icons, result labels */
  --teal-tint: #E3F1EF;
  --result-bg: #EAF5F4;
  --result-border: #9ACFCB;
  --sand: #F6F3EC;           /* page background */
  --sand-dark: #ECE7DC;
  --white: #FFFFFF;
  --ink: #0F2526;
  --ink-on-orange: #0B2426;
  --muted: #4C5966;
  --on-teal: #D5E7E4;
  --on-teal-muted: #A8C9C6;
  --orange: #FF6B1A;

  --font-head: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 37, 38, .06), 0 6px 20px rgba(15, 37, 38, .06);
  --tap: 48px;               /* minimum tap target (rule: ≥ 44px) */
  --container: 1160px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sand);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-accent); text-underline-offset: 3px; }
a:hover { color: var(--teal-deep); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 28px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--white); color: var(--ink); padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 22px;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: var(--ink-on-orange); }   /* the ONE orange button per view */
.btn-primary:hover { background: #FF7F3A; color: var(--ink-on-orange); }
.btn-dark { background: var(--teal-deep); color: var(--white); }
.btn-dark:hover { background: #0E4C4E; color: var(--white); }
.btn-ghost-light { border-color: rgba(213, 231, 228, .55); color: var(--white); background: transparent; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
.btn-outline { border-color: var(--teal-deep); color: var(--teal-deep); background: var(--white); }
.btn-outline:hover { background: var(--teal-tint); color: var(--teal-deep); }

/* ---------- 4. Header ---------- */
.site-header { background: var(--teal-deep); color: var(--white); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); margin-right: auto; min-height: var(--tap); }
.brand img { width: 36px; height: 36px; }
.wordmark { font: 900 20px/1 var(--font-head); letter-spacing: .02em; color: var(--white); }
.wordmark b { color: var(--orange); font-weight: 900; }
.main-nav { display: none; gap: 4px; }
.main-nav a { color: var(--on-teal); text-decoration: none; font-weight: 600; padding: 12px 14px; border-radius: 8px; min-height: var(--tap); display: inline-flex; align-items: center; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--white); background: rgba(255,255,255,.08); }

.lang-switch { display: inline-flex; background: rgba(0,0,0,.22); border-radius: 999px; padding: 3px; }
.lang-switch button {
  min-width: var(--tap); min-height: 42px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--on-teal); font: 700 14px/1 var(--font-body); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--white); color: var(--teal-deep); }

/* ---------- 5. Home hero ---------- */
.hero { background: var(--teal-deep); color: var(--white); overflow: hidden; position: relative; }
.hero::before { /* soft light behind Rio — teal only, no orange glow */
  content: ''; position: absolute; right: -10%; top: 10%; width: 70vw; max-width: 720px; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(154, 207, 203, .22), rgba(11, 61, 63, 0) 65%); pointer-events: none;
}
.hero .container { display: grid; gap: 8px; padding-top: 36px; padding-bottom: 0; position: relative; }
.hero-kicker { color: var(--on-teal-muted); font-weight: 600; font-size: 14px; letter-spacing: .04em; margin-bottom: 14px; }
.hero h1 { font-size: 34px; font-weight: 900; margin-bottom: 16px; }
.hero h1 .line { display: block; text-wrap: balance; }
.hero h1 .hl { color: var(--orange); }   /* hero highlight line — allowed orange */
.hero-lead { color: var(--on-teal); font-size: 17px; max-width: 34em; margin-bottom: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.hero-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 12px; }
.hero-art img { width: 200px; filter: drop-shadow(0 18px 24px rgba(0,0,0,.35)); }

.bubble {
  position: relative; background: var(--white); color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1.35;
  padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow); max-width: 230px;
}
.hero-art .bubble { z-index: 1; text-align: center; }
.hero-art .bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -9px; border: 9px solid transparent; border-top-color: var(--white); border-bottom: 0; }

/* ---------- 6. Sections ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-head p { color: var(--muted); margin: 0; max-width: 40em; }
.count-pill { background: var(--sand-dark); color: var(--ink); font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; }

/* Calculator cards */
.calc-grid { display: grid; gap: 14px; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
.calc-card {
  display: grid; grid-template-columns: 52px 1fr; gap: 4px 14px; align-items: start;
  background: var(--white); border: 1px solid var(--sand-dark); border-radius: var(--radius);
  padding: 18px; color: var(--ink); text-decoration: none; height: 100%; min-height: var(--tap);
}
a.calc-card { box-shadow: var(--shadow); transition: border-color .15s ease, transform .15s ease; }
a.calc-card:hover { border-color: var(--result-border); transform: translateY(-2px); color: var(--ink); }
.calc-card.is-soon { background: transparent; border-style: dashed; border-color: #CFC8B8; }
.calc-icon { grid-row: span 3; width: 52px; height: 52px; border-radius: 12px; background: var(--teal-tint); color: var(--teal-accent); display: grid; place-items: center; }
.calc-icon svg { width: 28px; height: 28px; }
.calc-card h3 { margin: 2px 0 2px; font-size: 18px; }
.calc-card p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { justify-self: start; margin-top: 8px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-live { background: var(--teal-deep); color: var(--white); }
.tag-soon { background: var(--sand-dark); color: var(--muted); }

/* Why */
.why-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.why-item { background: var(--white); border-radius: var(--radius); padding: 20px; border-left: 4px solid var(--teal-accent); }
.why-item h3 { font-size: 18px; }
.why-item p { margin: 0; color: var(--muted); }

/* Directory promo */
.promo { background: var(--teal-tint); border-radius: 20px; display: grid; gap: 12px; padding: 28px 22px 0; overflow: hidden; }
.promo h2 { font-size: 26px; }
.promo p { color: var(--ink); }
.promo-art { display: flex; justify-content: center; align-items: flex-end; }
.promo-art img { width: 200px; }
.pill-soon { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; border-radius: 999px; background: var(--white); border: 1px dashed var(--teal-accent); color: var(--teal-deep); font-weight: 700; }

/* ---------- 7. Footer ---------- */
.site-footer { background: var(--teal-footer); color: var(--on-teal); padding: 40px 0 28px; margin-top: 24px; }
.site-footer a { color: var(--on-teal); }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.footer-grid h2 { font-size: 15px; font-family: var(--font-body); font-weight: 700; color: var(--white); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-grid li a, .footer-grid li span { display: inline-flex; min-height: 40px; align-items: center; }
.footer-grid li span { color: var(--on-teal-muted); }
.footer-small { border-top: 1px solid rgba(255,255,255,.1); margin-top: 28px; padding-top: 18px; font-size: 14px; color: var(--on-teal-muted); }
.footer-small p { margin: 0 0 6px; }

/* ---------- 8. Rio chat button + panel ---------- */
.rio-chat-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 68px; height: 68px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(7, 43, 45, .35));
}
.rio-chat-btn img { width: 68px; height: 68px; }
.rio-chat-panel {
  position: fixed; right: 16px; bottom: 96px; z-index: 60; width: min(340px, calc(100vw - 32px));
  background: var(--white); border-radius: 18px; box-shadow: 0 12px 40px rgba(7, 43, 45, .25); overflow: hidden;
}
.rio-chat-panel[hidden] { display: none; }
.rio-chat-head { background: var(--teal-deep); color: var(--white); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; }
.rio-chat-head img { width: 40px; height: 40px; }
.rio-chat-head strong { font-family: var(--font-head); font-weight: 800; flex: 1; }
.icon-btn { min-width: var(--tap); min-height: var(--tap); border: 0; border-radius: 10px; background: transparent; color: inherit; font-size: 22px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.rio-chat-body { padding: 16px; margin: 0; }

/* ---------- 9. Calculator page ---------- */
.page-head { background: var(--teal-deep); color: var(--white); padding: 18px 0 26px; }
.crumbs { font-size: 14px; margin-bottom: 10px; color: var(--on-teal-muted); }
.crumbs a { color: var(--on-teal); display: inline-flex; min-height: 40px; align-items: center; }
.crumbs span[aria-hidden] { margin: 0 6px; }
.page-head h1 { font-size: 32px; font-weight: 900; margin-bottom: 8px; }
.page-head .lead { color: var(--on-teal); max-width: 40em; margin-bottom: 16px; }
.rio-tip { display: flex; align-items: center; gap: 12px; }
.rio-tip img { width: 56px; height: 56px; flex: none; }
.rio-tip .bubble { max-width: none; }
.rio-tip .bubble::before { content: ''; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: var(--white); border-left: 0; }

.calc-layout { display: grid; gap: 20px; padding: 24px 0 8px; }
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--sand-dark); padding: 20px; }

/* Form controls */
.field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.field > legend, .label { font-weight: 700; margin-bottom: 8px; padding: 0; display: block; font-size: 16px; }
.help { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--sand); padding: 4px; border-radius: 12px; border: 1px solid var(--sand-dark); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap);
  border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--ink); text-align: center; padding: 6px 8px;
}
.segmented input:checked + label { background: var(--teal-deep); color: var(--white); }
.segmented input:focus-visible + label { outline: 3px solid var(--orange); outline-offset: 2px; }

.dim-row { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 8px; }
.dim-row.no-feet { grid-template-columns: 1fr 1.15fr; }
.unit-input { position: relative; }
.unit-input input, .unit-input select, .select, .input {
  width: 100%; min-height: 52px; padding: 12px 44px 12px 14px;
  font: 600 18px/1.2 var(--font-body); color: var(--ink);       /* ≥16px stops iOS zoom */
  background: var(--white); border: 2px solid #CFC8B8; border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
}
.unit-input select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--teal-deep) 50%), linear-gradient(135deg, var(--teal-deep) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--teal-deep) 50%), linear-gradient(135deg, var(--teal-deep) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.input { padding-right: 14px; }
.unit-input input:focus, .unit-input select:focus, .select:focus, .input:focus { border-color: var(--teal-accent); outline: none; box-shadow: 0 0 0 3px rgba(11, 110, 106, .2); }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 14px; pointer-events: none; }
.unit-input.prefix input { padding-left: 30px; padding-right: 14px; }
.unit-input.prefix .unit { left: 13px; right: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { min-width: 64px; min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 999px; border: 2px solid #CFC8B8; background: var(--white); font-weight: 700; cursor: pointer; }
.chips input:checked + label { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--white); }
.chips input:focus-visible + label { outline: 3px solid var(--orange); outline-offset: 2px; }

.two-col { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
details.optional { border-top: 1px solid var(--sand-dark); padding-top: 4px; margin-bottom: 8px; }
details.optional summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 700; cursor: pointer; color: var(--teal-deep); }
details.optional[open] summary { margin-bottom: 8px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Results — light background, never red */
.results { background: var(--result-bg); border: 2px solid var(--result-border); border-radius: var(--radius); padding: 20px; }
.results h2 { font-size: 15px; font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-accent); margin-bottom: 12px; }
.results-empty { color: var(--muted); margin: 0; }
.result-main { margin-bottom: 14px; }
.result-label { color: var(--teal-accent); font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.result-value { font: 900 40px/1.05 var(--font-head); color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }  /* rule: main result 40px */
.result-value .u { font-size: 24px; font-weight: 800; margin-left: 6px; }
.result-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.result-rows { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--result-border); }
.result-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--result-border); }
.result-rows .k { font-weight: 600; }
.result-rows .v { font: 800 20px/1.2 var(--font-head); text-align: right; margin-left: auto; }
.result-rows .note { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-weight: 600; color: var(--ink); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--teal-deep); }
.copy-status { font-size: 14px; color: var(--teal-deep); font-weight: 700; margin-left: 8px; }
.results .btn-dark { width: 100%; }

/* How we calculate + find a pro */
.how { margin-top: 4px; }
.how h2 { font-size: 22px; }
.how ul { padding-left: 20px; margin: 0 0 12px; }
.how li { margin-bottom: 6px; }
.how .muted { color: var(--muted); font-size: 15px; }
.pro-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; background: var(--teal-tint); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0 32px; }
.pro-card img { width: 64px; height: 64px; }
.pro-card .txt { flex: 1 1 220px; }
.pro-card h2 { font-size: 20px; margin-bottom: 4px; }
.pro-card p { margin: 0; color: var(--ink); }
.pro-link[aria-disabled="true"] { cursor: default; }

/* ---------- 10. Wider screens ---------- */
@media (min-width: 600px) {
  .calc-grid { grid-template-columns: 1fr 1fr; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .hero-art img { width: 260px; }
}
@media (min-width: 760px) {
  .main-nav { display: flex; }
}
@media (min-width: 900px) {
  h2 { font-size: 34px; }
  .hero .container { grid-template-columns: 1.4fr .6fr; align-items: center; padding-top: 56px; }
  .hero h1 { font-size: 60px; }                 /* rule: 60px desktop / 34px phone */
  .hero-lead { font-size: 19px; }
  .hero-copy { padding-bottom: 56px; }
  .hero-art { margin-top: 0; padding-top: 28px; }
  .hero-art img { width: 290px; }
  .section { padding: 72px 0; }
  .calc-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid { grid-template-columns: repeat(4, 1fr); }
  .promo { grid-template-columns: 1fr 260px; align-items: center; padding: 36px 40px 0; }
  .promo > div:first-child { padding-bottom: 36px; }
  .page-head { padding: 22px 0 32px; }
  .page-head h1 { font-size: 44px; }
  .calc-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start; }
  .calc-layout .results { position: sticky; top: 84px; }
}
.section.flush-top { padding-top: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 11. Small helpers ---------- */
.input-short { max-width: 140px; }
.price-grid { margin-top: 10px; }
.tag-inline { margin: 0; }

/* Phones: smaller Rio button, and room at the bottom so it never hides the footer */
@media (max-width: 599px) {
  body { padding-bottom: 72px; }
  .rio-chat-btn, .rio-chat-btn img { width: 56px; height: 56px; }
  .rio-chat-btn { right: 12px; bottom: 12px; }
  .rio-chat-panel { bottom: 80px; right: 12px; }
}
