/* =========================================================
   Antico Borgo Experiences — Design system condiviso
   Palette: navy profondo + oro, sfondo crema. Lusso mediterraneo.
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Karla:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,400&display=swap');

:root {
  --navy-950: #0d1729;
  --navy-900: #16233f;
  --navy-800: #1e3a5f;
  --navy-700: #274a76;
  --gold-700: #7d5a1e;
  --gold-600: #a3762a;
  --gold-500: #b98a35;
  --gold-400: #d4a04a;
  --gold-100: #f3ead8;
  --gold-50: #fbf6e9;
  --cream-50: #faf8f3;
  --cream-100: #f4f0e7;
  --cream-200: #ebe4d3;
  --white: #ffffff;
  --ink: #232a36;
  --ink-soft: #5b6472;
  --ink-mute: #8a91a0;
  --border: #e5ded0;
  --border-soft: #efe9dc;
  --success-600: #1d7a4f;
  --success-100: #e2f3ea;
  --danger-600: #b3352f;
  --danger-100: #f9e5e4;
  --warn-700: #8a6414;
  --warn-100: #faf1d9;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 3px rgba(22, 35, 63, 0.08);
  --shadow-md: 0 8px 28px rgba(22, 35, 63, 0.10);
  --shadow-lg: 0 20px 56px rgba(22, 35, 63, 0.18);
  --shadow-hero: 0 30px 80px rgba(13, 23, 41, 0.22);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-body: 'Karla', -apple-system, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream-50);
  min-height: 100dvh;
}

h1, h2, h3, .font-display { font-family: var(--font-display); color: var(--navy-900); letter-spacing: -0.005em; }
h1 { font-weight: 500; }
h2 { font-weight: 500; }
h3 { font-weight: 600; }
.eyebrow, .caps {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.divider-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-500);
}
.divider-line::before, .divider-line::after {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

img, svg { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

a { color: var(--navy-800); }

:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: 0.005em;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), background 0.22s var(--ease-out), opacity 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  position: relative;
  will-change: transform;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(22, 35, 63, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  box-shadow: 0 8px 22px rgba(22, 35, 63, 0.34), inset 0 1px 0 rgba(255,255,255,0.08);
  transform: translateY(-2px);
}
.btn-gold {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 40%),
    linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 50%, var(--gold-700) 100%);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(163, 118, 42, 0.34), inset 0 1px 0 rgba(255,255,255,0.28);
  overflow: hidden;
}
.btn-gold::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transition: left 0.7s var(--ease-out);
}
.btn-gold:hover { box-shadow: 0 12px 28px rgba(163, 118, 42, 0.44), inset 0 1px 0 rgba(255,255,255,0.32); transform: translateY(-2px); }
.btn-gold:hover::before { left: 130%; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy-900);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--navy-900);
  background: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-icon {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
}
.btn-danger { background: var(--danger-100); color: var(--danger-600); }
.btn-danger:hover { background: #f3d6d4; }
.btn-success { background: var(--success-600); color: var(--white); }
.btn-success:hover { filter: brightness(1.08); }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 14.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Form ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 6px;
  color: var(--navy-900);
}
.field label .req { color: var(--danger-600); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 138, 53, 0.15);
}
.field .hint { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.field .error { font-size: 13.5px; color: var(--danger-600); margin-top: 4px; display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger-600); }
.field.has-error .error { display: block; }

/* ---------- Badge stato ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}
.badge-pending { background: var(--warn-100); color: var(--warn-700); }
.badge-confirmed { background: var(--success-100); color: var(--success-600); }
.badge-confirmed::before { animation: none; }
.badge-rejected { background: var(--danger-100); color: var(--danger-600); }
.badge-rejected::before { animation: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(229, 222, 208, 0.6);
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--navy-900);
  color: var(--white);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
}
.toast.success { background: var(--success-600); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast { position: relative; overflow: hidden; padding-bottom: 16px; }
.toast.fade-out { animation: toastOut 0.4s var(--ease-out) forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(12px); }
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
  transform-origin: left;
  animation: toastFill 3.3s linear forwards;
}
.toast.success .toast-progress { background: linear-gradient(90deg, #4dbe80, var(--success-600)); }
@keyframes toastFill {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 35, 63, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--cream-50);
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  animation: sheetUp 0.3s cubic-bezier(0.32, 0.72, 0.22, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: var(--radius-lg); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }

.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
  background: var(--cream-50);
  z-index: 2;
}
.modal-head h2 { font-size: 22px; }
.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream-100);
  color: var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 6px 22px 26px; }
.modal-magazine { padding-bottom: 0; overflow: hidden; }
.modal-magazine .modal-body-magazine { max-height: 92dvh; overflow-y: auto; padding-bottom: calc(env(safe-area-inset-bottom) + 20px); }
.modal-close-floating {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.modal-close-floating:hover { background: var(--white); transform: scale(1.05); }
.modal-body-magazine .svc-long,
.modal-body-magazine .detail-rows,
.modal-body-magazine .detail-price-box,
.modal-body-magazine .booking-block { margin-left: 22px; margin-right: 22px; }
.modal-body-magazine .svc-long { margin-top: 22px; }

/* ---------- Colori categorie ---------- */
.cat-mare { background: linear-gradient(135deg, #2a6f97, #1e3a5f); }
.cat-escursioni { background: linear-gradient(135deg, #5a7d4f, #33502c); }
.cat-gusto { background: linear-gradient(135deg, #b98a35, #8a5a22); }
.cat-esperienze { background: linear-gradient(135deg, #7d5a9e, #46316b); }

/* ---------- Modal success (prenotazione confermata) ---------- */
.modal-success { text-align: center; padding: 0; overflow: hidden; }
.success-visual {
  position: relative;
  padding: 46px 20px 24px;
  background: radial-gradient(circle at 50% 60%, var(--gold-50), var(--cream-50));
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}
.success-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringPop 0.5s var(--ease-out) both;
  box-shadow: 0 20px 44px rgba(163, 118, 42, 0.36);
}
.success-ring-inner {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--white);
}
.success-check {
  position: relative;
  z-index: 2;
  width: 60px;
  height: 60px;
  color: var(--gold-600);
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: checkDraw 0.6s var(--ease-out) 0.35s forwards;
}
@keyframes ringPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}
.success-sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  opacity: 0;
  animation: sparkOut 1.2s var(--ease-out) 0.4s forwards;
}
.sp1 { top: 30%; left: 30%; }
.sp2 { top: 20%; left: 60%; --sd: 40px; }
.sp3 { top: 50%; left: 20%; --sd: -50px; }
.sp4 { top: 70%; left: 70%; --sd: 45px; }
.sp5 { top: 25%; left: 75%; --sd: 55px; }
.sp6 { top: 65%; left: 30%; --sd: -55px; }
@keyframes sparkOut {
  0% { opacity: 0; transform: scale(0.3); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translate(var(--sd, 0), var(--sd, 0)) scale(0.4); }
}
.success-body { padding: 12px 26px 30px; }
.success-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin: 4px 0 10px;
}
.success-body h2 em { font-family: var(--font-serif); font-style: italic; color: var(--gold-600); font-weight: 400; }
.success-body p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.success-actions .btn { width: 100%; }
@media (min-width: 500px) {
  .success-actions { flex-direction: row; justify-content: center; }
  .success-actions .btn { width: auto; }
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
}
.empty svg { width: 48px; height: 48px; margin: 0 auto 14px; color: var(--gold-500); }
.empty h3 { font-size: 20px; margin-bottom: 6px; }
.empty p { font-size: 15px; max-width: 320px; margin: 0 auto 18px; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.text-soft { color: var(--ink-soft); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
