/* ═══════════════════════════════════════════════════════════════════
   style.css  –  GrEst Iscrizione  |  Tema Oro & Bianco
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── VARIABILI ─────────────────────────────────────────────────── */
:root {
  --gold:        #B8892A;
  --gold-light:  #D4A94A;
  --gold-pale:   #F5EDD8;
  --gold-border: #E2C97E;
  --gold-deep:   #8B6820;

  --white:       #FFFFFF;
  --off-white:   #FAFAF8;
  --surface:     #F7F3EC;
  --surface2:    #EDE7D9;

  --text:        #1A1208;
  --text-mid:    #5C4A2A;
  --text-light:  #9A8060;
  --text-xlight: #BBA880;

  --border:      #DDD0B0;
  --border-light:#EDE5CC;

  --green:       #2A7A48;
  --green-light: #E8F5EE;
  --red:         #C0392B;

  --radius:      8px;
  --radius-sm:   4px;
  --shadow-sm:   0 1px 4px rgba(120,90,20,0.08);
  --shadow:      0 4px 16px rgba(120,90,20,0.12);
  --shadow-lg:   0 12px 40px rgba(120,90,20,0.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Pattern di sfondo ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(184,137,42,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(184,137,42,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════════════ */
#landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px 80px;
}

.parish-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 36px;
  font-weight: 500;
}

.hero-cross {
  font-size: 2rem;
  color: var(--gold);
  display: block;
  margin-bottom: 12px;
  opacity: 0.8;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 700;
  color: var(--gold-deep);
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 4px;
}

.hero-year {
  font-family: 'Playfair Display', serif;
  font-size: clamp(4.5rem, 13vw, 8rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 16px;
}

.hero-theme {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-mid);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.divider-ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 24px;
  width: 200px;
}

.divider-ornament span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-border));
}

.divider-ornament span:last-child {
  background: linear-gradient(to left, transparent, var(--gold-border));
}

.divider-ornament i {
  font-style: normal;
  color: var(--gold);
  font-size: 0.7rem;
}

.hero-desc {
  max-width: 460px;
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 24px rgba(139,104,32,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(139,104,32,0.45);
}

.btn-primary:active { transform: translateY(0); }

.hero-dates {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-xlight);
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM SECTION
   ═══════════════════════════════════════════════════════════════════ */
#form-section {
  display: none;
  position: relative;
  z-index: 1;
  padding: 40px 20px 60px;
}

#form-section.fade-in {
  animation: fadeUp 0.4s ease;
}

.form-container {
  max-width: 720px;
  margin: 0 auto;
}

/* ── FORM HEADER ── */
.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-header .cross {
  font-size: 1.4rem;
  color: var(--gold);
  display: block;
  margin-bottom: 10px;
}

.form-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.form-header p {
  font-size: 0.8rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
}

/* ── STEPS BAR ── */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s;
}

.step-label {
  font-size: 0.65rem;
  color: var(--text-xlight);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.step-dot.active .step-num {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  border-color: var(--gold);
  color: white;
  box-shadow: 0 2px 10px rgba(184,137,42,0.4);
}

.step-dot.active .step-label { color: var(--gold-deep); font-weight: 600; }

.step-dot.done .step-num {
  background: var(--gold-pale);
  border-color: var(--gold-border);
  color: var(--gold-deep);
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-light);
  min-width: 16px;
  max-width: 40px;
  margin-bottom: 20px;
  transition: background 0.3s;
}

/* ── STEP PANELS ── */
.step-panel { display: none; animation: fadeUp 0.3s ease; }
.step-panel.active { display: block; }

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

@media(max-width: 600px) { .card { padding: 20px 18px; } }

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .icon { font-size: 1.1rem; }

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.5;
}

.required-note {
  font-size: 0.75rem;
  color: var(--text-xlight);
  margin-bottom: 16px;
}

/* ── FIELDS ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  background: var(--off-white);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(184,137,42,0.12);
}

.field input::placeholder { color: var(--text-xlight); }

.field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.field input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field-row.single { grid-template-columns: 1fr; max-width: 300px; }
.field-row.triple { grid-template-columns: 2fr 1fr 1fr; }

@media(max-width: 500px) {
  .field-row, .field-row.triple { grid-template-columns: 1fr; }
  .field-row.single { max-width: 100%; }
}

/* ── SECTION LABELS ── */
.section-sublabel {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* ── NUM STEPPER ── */
.num-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.num-stepper button {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  color: var(--gold-deep);
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 600;
}

.num-stepper button:hover { background: var(--gold-pale); }

.num-stepper span {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  width: 44px;
  text-align: center;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

/* ── INFO NOTE ── */
.info-note {
  background: var(--gold-pale);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ── DELEGATI ── */
.delegate-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.delegate-row .field { flex: 1; min-width: 140px; }

.btn-add-delegate {
  background: none;
  border: 1.5px dashed var(--gold-border);
  color: var(--gold);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-add-delegate:hover { background: var(--gold-pale); }

/* ── CHILD SECTIONS ── */
.child-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.child-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.child-badge {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── WEEKS GRID ── */
.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.week-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  position: relative;
}

.week-option:hover { border-color: var(--gold-border); background: var(--gold-pale); }

.week-option.selected {
  border-color: var(--gold);
  background: var(--gold-pale);
  box-shadow: 0 0 0 3px rgba(184,137,42,0.12);
}

.week-check {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--gold-deep);
  font-weight: 700;
  transition: all 0.2s;
  background: var(--white);
}

.week-option.selected .week-check {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}

.week-name { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 2px; }
.week-dates { font-size: 0.75rem; color: var(--text-light); margin-bottom: 4px; }
.week-price { font-size: 0.78rem; color: var(--gold-deep); font-weight: 600; }

/* ── SIZE BUTTONS ── */
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }

.size-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.size-btn:hover { border-color: var(--gold-border); background: var(--gold-pale); }

.size-btn.selected {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  border-color: var(--gold);
  color: white;
  box-shadow: 0 2px 8px rgba(184,137,42,0.3);
}

/* ── NAV BUTTONS ── */
.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.btn-nav {
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-back {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}

.btn-back:hover { border-color: var(--gold-border); color: var(--gold-deep); }

.btn-next {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  border: none;
  color: white;
  box-shadow: 0 4px 16px rgba(139,104,32,0.3);
}

.btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(139,104,32,0.4);
}

/* ── RECAP ── */
.recap-block {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
}

.recap-block h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.recap-item {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.4;
}

.recap-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

.price-summary {
  background: var(--white);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border-light);
}

.price-row:last-child { border-bottom: none; }

.price-row.total {
  background: var(--gold-pale);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-deep);
}

/* ═══════════════════════════════════════════════════════════════════
   SUCCESS SECTION
   ═══════════════════════════════════════════════════════════════════ */
#success-section {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  position: relative;
  z-index: 1;
}

#success-section.active {
  display: flex;
}

.success-card {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.success-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
}

.success-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 16px;
}

.success-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 16px;
}

.success-card > p {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 28px;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
  text-align: left;
}

.download-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-item-icon { font-size: 1.4rem; }

.download-item-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.download-item-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
}

.btn-download {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(139,104,32,0.25);
}

.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(139,104,32,0.35); }
.btn-download:disabled { opacity: 0.6; cursor: wait; transform: none; }

.success-card a { color: var(--gold); text-decoration: none; }
.success-card a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─── */
@media(max-width: 480px) {
  .btn-primary { padding: 14px 28px; font-size: 0.9rem; }
  .nav-row { flex-direction: column-reverse; }
  .btn-nav { width: 100%; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--white);
  border-left: 4px solid var(--red);
  color: var(--text);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  max-width: 350px;
  animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toast.fade-out {
  animation: toastFadeOut 0.3s ease forwards;
}

.toast-icon {
  color: var(--red);
  font-size: 1.2rem;
  line-height: 1;
}

.toast-content {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}
.toast-close:hover { color: var(--text-mid); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

@media(max-width: 480px) {
  #toast-container { top: 10px; right: 10px; left: 10px; align-items: center; }
  .toast { max-width: 100%; width: 100%; }
}
