@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@300;400;500;600&display=swap');

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

:root {
  --bg: #f2f0e6;
  --bg-card: #ffffff;
  --primary: #2b5d5d;
  --primary-hover: #1e4444;
  --primary-light: #3a7a7a;
  --accent: #c8a96e;
  --text: #2b5d5d;
  --text-light: #5a7a7a;
  --text-muted: #8a9a9a;
  --border: #d4cfc4;
  --border-focus: #2b5d5d;
  --error: #b94a48;
  --success: #2b7a4b;
  --shadow: 0 4px 24px rgba(43,93,93,0.10);
  --shadow-lg: 0 12px 48px rgba(43,93,93,0.15);
  --radius: 4px;
  --radius-lg: 8px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Jost', sans-serif;
  --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ─────────────────────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--primary);
  text-decoration: none;
  text-transform: uppercase;
}

.logo span {
  font-style: italic;
  font-weight: 300;
}

/* ── HERO BAND ───────────────────────────── */
.hero-band {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 48px 24px 40px;
}

.hero-band h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.hero-band p {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ── PROGRESS BAR ────────────────────────── */
.progress-wrapper {
  background: var(--bg);
  padding: 32px 24px 0;
  max-width: 720px;
  margin: 0 auto;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  margin-bottom: 40px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 1px;
  background: var(--border);
  transition: background var(--transition);
}

.step-item.completed:not(:last-child)::after {
  background: var(--accent);
}

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

.step-item.active .step-bubble {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(43,93,93,0.12);
}

.step-item.completed .step-bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition);
}

.step-item.active .step-label { color: var(--primary); }
.step-item.completed .step-label { color: var(--accent); }

/* ── MAIN CONTAINER ──────────────────────── */
.main-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── STEP PANELS ─────────────────────────── */
.step-panel {
  display: none;
  animation: fadeSlide 0.4s ease;
}

.step-panel.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.card-subtitle {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-weight: 500;
}

.divider {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 12px 0 28px;
}

/* ── TERMS BOX ───────────────────────────── */
.terms-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  height: 220px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 24px;
}

.terms-box h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 12px;
}

.terms-box::-webkit-scrollbar { width: 4px; }
.terms-box::-webkit-scrollbar-track { background: transparent; }
.terms-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── CHECKBOXES ──────────────────────────── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition);
  position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 8px; height: 12px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── DATE & TIME ─────────────────────────── */
.form-section {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.date-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}

.date-input:focus { border-color: var(--primary); }

.time-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.time-pill {
  padding: 12px 24px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.05em;
}

.time-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(43,93,93,0.04);
}

.time-pill.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Slot pieno — non cliccabile */
.time-pill--full {
  opacity: .45;
  cursor: not-allowed !important;
  border-style: dashed;
  pointer-events: none;
}

/* Slot suggerito come primo disponibile */
.time-pill--suggested {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43,93,93,.15);
  font-weight: 600;
}

/* Skeleton-loading mentre si caricano i dati */
.time-pill--loading {
  animation: pill-pulse .9s ease-in-out infinite;
}
@keyframes pill-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .45; }
}

/* Badge inline nel testo del pill */
.slot-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 100px;
  background: rgba(220,38,38,.12);
  color: #dc2626;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0;
}
.slot-badge--warn {
  background: rgba(217,119,6,.12);
  color: #d97706;
}

/* ── COVERS GRID ─────────────────────────── */
.covers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.cover-btn {
  aspect-ratio: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 70px;
}

.cover-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cover-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cover-btn.custom-btn {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.custom-input-wrap {
  display: none;
  margin-top: 14px;
}

.custom-input-wrap.visible { display: block; }

.custom-input-wrap .date-input {
  max-width: 200px;
}

/* ── ALERT BANNER ────────────────────────── */
.alert-banner {
  display: none;
  background: rgba(200,169,110,0.12);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 13px;
  color: #7a5a20;
  line-height: 1.6;
}

.alert-banner.visible { display: flex; gap: 12px; align-items: flex-start; }

.alert-banner svg { flex-shrink: 0; margin-top: 1px; }

/* ── PERSONAL DATA FORM ──────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

.input-field {
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.input-field:focus { border-color: var(--primary); }
.input-field.error { border-color: var(--error); }

.field-error {
  font-size: 11px;
  color: var(--error);
  display: none;
}

.field-error.visible { display: block; }

/* ── CREDIT CARD SECTION ─────────────────── */
.card-section {
  display: none;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.card-section.visible { display: block; }

.card-section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 6px;
}

.card-section-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(43,93,93,0.05);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.6;
}

.card-number-wrap {
  position: relative;
}

.card-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.cc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── RECAP ───────────────────────────────── */
.recap-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.recap-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recap-item span:first-child {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.recap-item span:last-child {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--primary);
  font-weight: 500;
}

/* ── BUTTONS ─────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 17px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn-primary:hover::before { background: rgba(255,255,255,0.08); }
.btn-primary:active { transform: translateY(1px); }

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 13px 24px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  align-items: center;
}

.btn-row .btn-primary { flex: 1; }

/* ── SUCCESS SCREEN ──────────────────────── */
#step-success {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(43,93,93,0.08);
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-check {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.6s ease 0.3s forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

#step-success .card-title { font-size: 38px; margin-bottom: 10px; }

#step-success p {
  color: var(--text-light);
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

.success-recap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: inline-flex;
  gap: 40px;
  margin-bottom: 32px;
  text-align: left;
  flex-wrap: wrap;
  justify-content: center;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #25D366;
  color: #fff;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: opacity var(--transition);
}

.whatsapp-btn:hover { opacity: 0.88; }

/* ── HEADER BOOK BUTTON ──────────────────── */
.header-book-btn {
  position: absolute;
  right: 32px;
  padding: 9px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.header-book-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ── HERO NOTICES ────────────────────────── */
.hero-notices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-notice {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 100px;
  padding: 5px 16px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* ── TIME GROUP LABELS ───────────────────── */
.time-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* ── PIZZERIA TIME PILLS ─────────────────── */
.time-pill--pizzeria {
  border-color: #b05e2a;
  color: #7a3d16;
  background: rgba(176,94,42,0.05);
}
.time-pill--pizzeria:hover {
  border-color: #b05e2a;
  color: #b05e2a;
  background: rgba(176,94,42,0.10);
}
.time-pill--pizzeria.selected {
  background: #b05e2a;
  border-color: #b05e2a;
  color: #fff;
}

/* ── PIZZERIA NOTE ───────────────────────── */
.pizzeria-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-style: italic;
}

/* ── REMINDER WIDGET ─────────────────────── */
.reminder-wrap {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(43,93,93,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.reminder-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  user-select: none;
}

.reminder-label svg {
  flex-shrink: 0;
  color: var(--primary);
}

.reminder-label span:first-of-type {
  flex: 1;
}

/* Hide native checkbox */
.reminder-label input[type="checkbox"] {
  display: none;
}

/* Custom toggle track */
.reminder-toggle {
  width: 42px;
  height: 24px;
  background: var(--border);
  border-radius: 100px;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition);
}
.reminder-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform var(--transition);
}
.reminder-label input:checked ~ .reminder-toggle {
  background: var(--primary);
}
.reminder-label input:checked ~ .reminder-toggle::after {
  transform: translateX(18px);
}

.reminder-note {
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.5;
  color: var(--text-muted);
}
.reminder-note--ok    { color: var(--success); }
.reminder-note--error { color: var(--error); }
.reminder-note--warn  { color: #7a5a20; }

/* ── SUCCESS REMINDER PILL ───────────────── */
.success-reminder-pill {
  display: inline-block;
  background: rgba(43,93,93,0.08);
  border: 1px solid rgba(43,93,93,0.20);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

/* ── FOOTER ──────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 16px 20px; }
  .hero-band { padding: 36px 20px 30px; }
  .card { padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .cc-grid { grid-template-columns: 1fr; }
  .covers-grid { grid-template-columns: repeat(4, 1fr); }
  .btn-row { flex-direction: column-reverse; }
  .btn-row .btn-secondary { width: 100%; }
  .recap-box { gap: 20px; }
  .success-recap { flex-direction: column; gap: 16px; }
  .progress-wrapper { padding: 24px 16px 0; }
  .step-label { font-size: 9px; }
  /* Previene zoom automatico su iOS/Android quando si tocca un input */
  input, select, textarea { font-size: 16px !important; }
}
