/* Vacabookly base: tokens, reset, type, buttons, calendar.
   Shape rule: panels and photos 14px, inputs 10px, buttons and chips full pill. */

:root {
  /* Brand: VacaBookly teal #019e95 and navy #022742 (from the logo).
     --accent is the teal darkened just enough for white text to pass AA. */
  --brand-teal: #019e95;
  --brand-navy: #022742;
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-2: #e7ecee;
  --ink: #0b2235;
  --ink-2: #44566a;
  --ink-3: #627385;
  --line: #d4dce1;
  --accent: #007a73;
  --accent-hover: #00645e;
  --accent-ink: #ffffff;
  --accent-soft: #dcf1ee;
  --booked: #dde4e8;
  --ok: #007a73;

  --radius: 14px;
  --radius-sm: 10px;
  --pill: 999px;
  --shadow: 0 1px 2px rgb(2 39 66 / 0.06), 0 18px 40px -18px rgb(2 39 66 / 0.28);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1620;
    --surface: #102030;
    --surface-2: #17293a;
    --ink: #e8eef2;
    --ink-2: #b0bfcb;
    --ink-3: #8597a6;
    --line: #22364a;
    --accent: #2cc4b8;
    --accent-hover: #4fd6cb;
    --accent-ink: #022742;
    --accent-soft: #0f3a40;
    --booked: #1d3042;
    --ok: #2cc4b8;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -18px rgb(0 0 0 / 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.02em; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--ink-2); }
.mono { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: -0.01em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 1.4em;
  border-radius: var(--pill); border: 1px solid transparent;
  font-weight: 550; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 1em; font-size: 0.92rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 500; }

/* Form fields */
.field { display: grid; gap: 6px; }
.field label { font-size: 0.88rem; font-weight: 550; }
.field .hint { font-size: 0.82rem; color: var(--ink-3); }
.field .err { font-size: 0.82rem; color: var(--accent); min-height: 1em; }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea.input { min-height: 96px; resize: vertical; }

/* Reveal on scroll (IntersectionObserver adds .is-in) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- Range calendar ---------- */
.cal { position: relative; }
.cal-nav { position: absolute; inset: -4px 0 auto; display: flex; justify-content: space-between; pointer-events: none; }
.cal-arrow {
  pointer-events: auto; width: 34px; height: 34px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.cal-arrow:disabled { opacity: 0.35; cursor: default; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.cal-title { text-align: center; font-weight: 600; margin-bottom: 12px; line-height: 26px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-dow { text-align: center; font-size: 0.72rem; color: var(--ink-3); padding-bottom: 6px; font-weight: 550; }
.cal-day {
  position: relative; aspect-ratio: 1; border: 0; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.86rem; color: var(--ink);
}
.cal-day span {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 100%; height: 100%; max-width: 44px; max-height: 44px; margin: auto; border-radius: var(--pill);
  transition: background-color 0.15s;
}
.cal-day.is-open:hover span { background: var(--surface-2); }
.cal-day.is-past { color: var(--ink-3); opacity: 0.5; cursor: default; }
.cal-day.is-booked { color: var(--ink-3); cursor: default; }
.cal-day.is-booked span {
  background: repeating-linear-gradient(-45deg, var(--booked) 0 3px, transparent 3px 7px);
  text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 60%, transparent);
}
.cal-day.is-checkout { cursor: pointer; color: var(--ink); }
.cal-day.is-short, .cal-day.is-out { opacity: 0.45; }
.cal-day.is-today span { box-shadow: inset 0 0 0 1px var(--ink-3); }
.cal-day.is-range::before, .cal-day.is-preview::before,
.cal-day.is-start.is-linked::before, .cal-day.is-end::before {
  content: ''; position: absolute; inset: 8% 0; background: var(--accent-soft);
}
.cal-day.is-start::before { left: 50%; }
.cal-day.is-end::before, .cal-day.is-preview-end::before { right: 50%; }
.cal-day.is-preview-end span { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-day.is-start span, .cal-day.is-end span { background: var(--ink); color: var(--bg); text-decoration: none; }
.cal-day.is-start.is-booked span, .cal-day.is-end.is-booked span { background: var(--ink); }
.cal--compact .cal-months { gap: 20px; }
.cal--compact .cal-day { font-size: 0.8rem; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.82rem; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend i { width: 16px; height: 16px; border-radius: var(--pill); display: inline-block; }
.cal-legend .k-open { box-shadow: inset 0 0 0 1px var(--line); }
.cal-legend .k-booked { background: repeating-linear-gradient(-45deg, var(--booked) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1px var(--line); }
.cal-legend .k-stay { background: var(--ink); }

.cal-skeleton .cal-day span { color: transparent; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .cal-skeleton .cal-day span { animation: none; } }
