/* ═══════════════════════════════════════════════════════════════════════════
   Wizard "Pianifica la Vacanza" — 4 step, vanilla JS state machine
   ═══════════════════════════════════════════════════════════════════════════ */

.wizard-page {
  background: var(--white);
  min-height: 100vh;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.wizard-hero {
  position: relative;
  padding: calc(var(--navbar-h) + var(--sp-xl)) var(--sp-md) var(--sp-xl);
  text-align: center;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}
.wizard-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean) 55%, var(--turq) 100%);
}
.wizard-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wizard-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 auto var(--sp-sm);
  max-width: 700px;
  text-shadow: 0 2px 20px rgba(8,47,73,.4);
}
.wizard-hero__sub {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  opacity: .9;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--sp-xl) var(--sp-md) 0;
  max-width: 600px;
  margin: 0 auto;
}
.wizard-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}
.wizard-progress__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
  transition: background 0.4s;
}
.wizard-progress__step.is-done:not(:last-child)::after {
  background: var(--coral);
}
.wizard-progress__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all 0.3s var(--ease-out-expo);
}
.wizard-progress__step.is-active .wizard-progress__dot {
  border-color: var(--coral);
  background: var(--coral);
  color: var(--white);
  box-shadow: 0 0 0 4px var(--coral-light);
}
.wizard-progress__step.is-done .wizard-progress__dot {
  border-color: var(--coral);
  background: var(--coral);
  color: var(--white);
}
.wizard-progress__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: color 0.3s;
}
.wizard-progress__step.is-active .wizard-progress__label { color: var(--coral-dark); }
.wizard-progress__step.is-done  .wizard-progress__label { color: var(--ocean); }

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.wizard-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-md) var(--sp-3xl);
}

/* ── Step panel ──────────────────────────────────────────────────────────── */
.wizard-step {
  display: none;
  animation: wizardFadeIn .35s var(--ease-out-expo) both;
}
.wizard-step.is-active { display: block; }
@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-step__title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--ocean-dark);
  margin-bottom: var(--sp-lg);
  text-align: center;
}
.wizard-step__subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: -var(--sp-md);
  margin-bottom: var(--sp-lg);
  font-size: 1.05rem;
}

/* ── Option grid ─────────────────────────────────────────────────────────── */
.wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-md);
}
.wizard-option {
  position: relative;
}
.wizard-option input[type="radio"],
.wizard-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.wizard-option__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-lg) var(--sp-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-spring), background 0.25s;
  text-align: center;
  min-height: 130px;
  user-select: none;
}
.wizard-option__card:hover {
  border-color: var(--ocean-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.wizard-option input:checked + .wizard-option__card {
  border-color: var(--coral);
  background: var(--cream);
  box-shadow: 0 0 0 3px var(--coral-light), var(--shadow-md);
  transform: translateY(-3px);
}
.wizard-option__emoji {
  font-size: 2.4rem;
  line-height: 1;
}
.wizard-option__label {
  font-weight: 600;
  color: var(--ink);
  font-size: .97rem;
}
.wizard-option__desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── Mese slider ─────────────────────────────────────────────────────────── */
.wizard-month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-sm);
}
.wizard-month-grid .wizard-option__card {
  min-height: auto;
  padding: var(--sp-sm);
}
.wizard-month-grid .wizard-option__label {
  font-size: .92rem;
}

/* ── Navigation buttons ──────────────────────────────────────────────────── */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-xl);
  gap: var(--sp-md);
}
.wizard-nav--right { justify-content: flex-end; }

.wizard-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.wizard-btn-back:hover { background: var(--border); color: var(--ink); }

.wizard-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-coral);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.wizard-btn-next:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: var(--shadow-xl), var(--shadow-coral);
}
.wizard-btn-next:disabled {
  opacity: .45;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

/* ── Result ──────────────────────────────────────────────────────────────── */
.wizard-result {
  display: none;
  animation: wizardFadeIn .4s var(--ease-out-expo) both;
}
.wizard-result.is-active { display: block; }

.wizard-result__header {
  text-align: center;
  padding: var(--sp-lg) 0;
}
.wizard-result__header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: var(--ocean-dark);
  margin-bottom: var(--sp-xs);
}
.wizard-result__header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.wizard-result__loading {
  text-align: center;
  padding: var(--sp-2xl);
  color: var(--text-muted);
}
.wizard-result__loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto var(--sp-md);
}
@keyframes spin { to { transform: rotate(360deg); } }

.wizard-result__sections {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
  margin-top: var(--sp-lg);
}
.wizard-result__section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ocean-dark);
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-xs);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}
.wizard-result__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-md);
}
.wizard-result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.wizard-result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.wizard-result-card__img {
  aspect-ratio: 16/10;
  background: var(--ocean-light);
  background-size: cover;
  background-position: center;
}
.wizard-result-card__body {
  padding: var(--sp-md);
}
.wizard-result-card__type {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--coral-dark);
  margin-bottom: 4px;
}
.wizard-result-card__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--sp-xs);
}
.wizard-result-card__link {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ocean);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wizard-result__ctas {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border);
}
.wizard-restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.wizard-restart-btn:hover { background: var(--border); color: var(--ink); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .wizard-options { grid-template-columns: repeat(2, 1fr); }
  .wizard-month-grid { grid-template-columns: repeat(3, 1fr); }
  .wizard-progress__label { display: none; }
  .wizard-progress__step:not(:last-child)::after { top: 15px; }
}
@media (max-width: 400px) {
  .wizard-options { grid-template-columns: 1fr 1fr; }
}

/* ── Racconto caldo itinerario (wizard) ─────────────────────────────────── */
.wizard-narrative {
  background: linear-gradient(135deg, #f5f1e8 0%, #eef4f7 100%);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 1.75rem;
  border: 1px solid var(--border, #e4ddcd);
}
.wizard-narrative p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #29404f;
  margin: 0 0 .85rem;
}
.wizard-narrative p:first-child {
  font-size: 1.18rem;
  font-weight: 600;
  color: #0a2840;
}
.wizard-narrative p:last-child {
  margin-bottom: 0;
  font-size: .95rem;
  color: #5a6b78;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: .85rem;
  margin-top: .25rem;
}
.wizard-narrative a { color: #1A6B9A; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(26,107,154,.35); }
.wizard-narrative a:hover { border-bottom-color: #1A6B9A; }
