:root {
  --bg: #f6f1eb;
  --surface: #ffffff;
  --surface-2: #f6f1eb;
  --surface-sunken: #eee5d6;
  --ink: #1a1a1a;
  --ink-strong: #1a1a1a;
  --ink-muted: #4a5568;
  --accent: #1c5461;
  --accent-deep: #0e2e37;
  --accent-mid: #16434e;
  --accent-soft: #e3edee;
  --accent-ink: #ffffff;
  --gold: #c8944a;
  --gold-deep: #a0763b;
  --border: #ddd5c8;
  --border-strong: #c9bda8;
  --ok: #2f7a4f;
  --ok-soft: #e2f0e6;
  --warn: #a1552b;
  --warn-soft: #f6e6da;
  --danger: #a13521;
  --danger-soft: #f3ddd6;
  --shadow: 0 2px 12px rgba(28,84,97,0.10);
  --shadow-lg: 0 4px 18px rgba(28,84,97,0.30);
  --shadow-sm: 0 2px 8px rgba(28,84,97,0.08);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: 0 20px 60px;
}

h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; margin: 0; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

/* ---------- Header ---------- */

.site-header {
  position: relative; overflow: hidden;
  margin: 0 -20px 0;
  padding: 40px 24px 36px;
  background: linear-gradient(160deg, var(--accent-deep) 0%, var(--accent-mid) 62%, var(--accent) 100%);
  color: #fff;
}
.site-header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(200,148,74,0.12) 0%, rgba(0,0,0,0) 50%),
    radial-gradient(circle at 80% 20%, rgba(42,115,132,0.18) 0%, rgba(0,0,0,0) 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background-image: linear-gradient(90deg, rgba(200,148,74,0), var(--gold), var(--gold-deep), var(--gold), rgba(200,148,74,0));
}
.header-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.lang-switch { text-align: right; margin-bottom: 6px; }
.lang-switch a { color: #fff; opacity: 0.6; text-decoration: none; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; padding: 2px 6px; }
.lang-switch a.active { opacity: 1; text-decoration: underline; }
.brand-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.brand-logo-public { display: block; width: 240px; height: auto; max-width: 100%; }
.header-contact { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; opacity: 0.92; }
.header-contact a { color: inherit; text-decoration: none; }

/* ---------- Barra "Sfoglia il menù" (sticky, segue lo scroll in alto) ---------- */

.menu-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin: 0 -20px; height: 46px; box-sizing: border-box;
  background: var(--gold); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  box-shadow: 0 2px 14px rgba(0,0,0,0.2);
  transition: background 0.15s;
}
.menu-topbar-icon { font-size: 1.15rem; line-height: 1; }
@media print { .menu-topbar { display: none !important; } }

/* ---------- Hero ---------- */

.hero { max-width: 640px; margin: 28px auto 0; text-align: center; }
.eyebrow { font-family: "Jost", sans-serif; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 6px; }
.hero h1 { font-size: 2.1rem; color: var(--accent); margin: 0 0 8px; }
.hero p { color: var(--ink-muted); font-size: 1rem; margin: 0; }

/* ---------- Cards ---------- */

.card {
  max-width: 640px; margin: 22px auto 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 22px;
}
.card-title { font-size: 1.3rem; color: var(--accent); margin: 0 0 4px; }
.card-sub { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 18px; }

.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); margin-bottom: 6px; font-weight: 600; }
.field-group input[type="date"], .field-group input[type="text"], .field-group input[type="tel"], .field-group input[type="email"], .field-group textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink); font-size: 1rem;
}
.field-group input:focus, .field-group textarea:focus { border-color: var(--accent); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.people-stepper { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 8px 14px; width: fit-content; }
.people-stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--accent); font-size: 1.1rem; cursor: pointer; }
.people-stepper span { font-size: 1.15rem; font-weight: 600; min-width: 2.4ch; text-align: center; }

.slot-note { background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-s); padding: 10px 14px; font-size: 0.85rem; margin-bottom: 12px; }
.slots-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--ink); font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.slot-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.slot-chip.full { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
.slots-empty { color: var(--ink-muted); font-size: 0.9rem; }

/* Calendario colorato (libero/pieno/chiuso) sostituisce il vecchio input
   type="date" nella pagina pubblica di prenotazione. */
.cal-widget {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 12px; margin-bottom: 4px;
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-month-label { font-weight: 600; color: var(--accent); font-size: 0.98rem; text-transform: capitalize; }
.cal-nav {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--accent); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays { margin-bottom: 4px; }
.cal-weekdays span {
  text-align: center; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-muted); font-weight: 600;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font-size: 0.88rem; font-weight: 600; cursor: pointer; padding: 0;
  opacity: 1; -webkit-appearance: none; appearance: none;
}
.cal-day.cal-day-pad { visibility: hidden; cursor: default; border: none; background: none; }
.cal-day.libero { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.cal-day.pieno { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.cal-day.chiuso { background: var(--surface-sunken); border-color: var(--border); color: var(--ink-muted); }
.cal-day.fuori-range { background: var(--surface-sunken); border-color: var(--border); color: var(--border-strong); }
.cal-day.non-cliccabile { cursor: not-allowed; }
.cal-day.oggi { box-shadow: inset 0 0 0 2px var(--gold); }
.cal-day.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.cal-legend span { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--ink-muted); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid var(--border-strong); }
.cal-dot.libero { background: var(--surface); }
.cal-dot.pieno { background: var(--danger); border-color: var(--danger); }
.cal-dot.chiuso { background: var(--surface-sunken); }

.occasion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.occasion-chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--ink-muted); font-size: 0.85rem; cursor: pointer;
}
.occasion-chip.selected { background: var(--gold); color: #fff; border-color: var(--gold-deep); }

.submit-btn {
  width: 100%; padding: 15px; border-radius: 999px; border: none; background: var(--accent); color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 6px; box-shadow: var(--shadow-sm);
}
.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-s); padding: 10px 14px; font-size: 0.88rem; margin-bottom: 14px; }

/* ---------- Confirmation ---------- */

#confirmation-card { display: none; }
.status-pill-big {
  display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px;
}
.status-pill-big.confermata { background: var(--ok-soft); color: var(--ok); }
.status-pill-big.in_attesa { background: var(--warn-soft); color: var(--warn); }
.confirmation-details { background: var(--surface-2); border-radius: var(--radius-s); padding: 14px 16px; font-size: 0.95rem; margin: 14px 0; }
.confirmation-details div + div { margin-top: 6px; }
.confirmation-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.confirmation-actions a, .confirmation-actions button {
  flex: 1; min-width: 140px; text-align: center; padding: 11px 14px; border-radius: var(--radius-s);
  font-weight: 600; font-size: 0.88rem; text-decoration: none; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink);
}
.confirmation-actions .wa-btn { background: #0c6e62; color: #fff; border-color: #0c6e62; }

/* ---------- Popup di esito prenotazione ---------- */

.result-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,16,12,0.5); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.result-modal-box {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-l);
  box-shadow: var(--shadow-lg); padding: 26px 22px; text-align: center; border-top: 5px solid var(--border);
}
.result-modal-overlay.result-ok .result-modal-box { border-top-color: var(--ok); }
.result-modal-overlay.result-fail .result-modal-box { border-top-color: var(--danger); }
.result-modal-box h3 { font-size: 1.2rem; margin: 0 0 10px; color: var(--ink-strong); }
.result-modal-box p { margin: 0 0 20px; color: var(--ink-muted); font-size: 0.92rem; }
.result-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.result-modal-actions button, .result-modal-actions a {
  padding: 11px 14px; border-radius: var(--radius-s); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; text-decoration: none; text-align: center;
}
#result-modal-close { border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); }

/* ---------- Footer / map ---------- */

.info-footer { max-width: 640px; margin: 30px auto 0; text-align: center; color: var(--ink-muted); font-size: 0.88rem; }
.info-footer p { margin: 4px 0; }
.info-footer a, .card-sub a { color: inherit; text-decoration: underline; }

.map-section { max-width: 640px; margin: 20px auto 0; }
.map-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
}
.map-card svg { flex-shrink: 0; color: var(--accent); }
.map-card-text strong { display: block; color: var(--accent); }
.map-card-text span { font-size: 0.85rem; color: var(--ink-muted); }

.staff-access { max-width: 640px; margin: 28px auto 0; text-align: center; }
.staff-access a { color: var(--ink-muted); font-size: 0.78rem; text-decoration: none; opacity: 0.7; }

/* Gli effetti "hover" valgono solo per chi usa un mouse: su touchscreen,
   dopo un tocco l'hover resta "appiccicato" e il pulsante rimane schiarito
   finché non si tocca altrove. */
@media (hover: hover) and (pointer: fine) {
  .menu-topbar:hover { background: var(--gold-deep); }
  .people-stepper button:hover { background: var(--accent-soft); }
  .cal-nav:hover:not(:disabled) { background: var(--accent-soft); }
  .cal-day.libero:hover:not(.selected) { border-color: var(--accent); background: var(--accent-soft); }
  .submit-btn:hover { filter: brightness(1.06); }
  .map-card:hover { background: var(--surface-2); }
  .staff-access a:hover { opacity: 1; text-decoration: underline; }
}
button, .cal-day { -webkit-tap-highlight-color: transparent; }
