:root {
  --color-primary: #c85a32;       /* Arancione / Mattone per bottoni, bordi attivi e accenti */
  --color-primary-dark: #6b1d2f;  /* Colore del Vino (Burgundy) per brand, monogram sposi, titoli */
  --color-mattone: #c85a32;
  --color-wine: #6b1d2f;
  --color-bg: #fffaf7;           /* Sfondo caldo e accogliente */
  --color-card: #ffffff;
  --color-text: #111111;         /* Scritte nere nitide per massima leggibilità */
  --color-muted: #4a4a4a;        /* Testo secondario scuro leggibile */
  --color-border: #f0dcd3;       /* Bordo elegante sfumato */
  --color-success: #3f6b45;
  --color-danger: #c1584f;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-script: 'Great Vibes', 'Alex Brush', cursive;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  padding-bottom: 84px; /* spazio per bottom nav mobile */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 8px;
}

a { color: var(--color-primary-dark); }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px;
}

/* ---- Header ---- */
.top-hero {
  text-align: center;
  padding: 36px 18px 26px;
  background: linear-gradient(180deg, #fceee6 0%, var(--color-bg) 100%);
}
.top-hero .monogram {
  font-family: var(--font-script);
  font-size: 3.4rem;
  letter-spacing: 0;
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-wine);
}
.top-hero .subtitle {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}
.countdown {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--color-primary-dark);
  background: #fff;
  display: inline-block;
  padding: 6px 16px;
  border-radius: 30px;
  border: 1px solid var(--color-border);
}

/* ---- Card ---- */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(60, 40, 20, 0.04);
}

/* ---- Partecipante ---- */
.participant {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 16px;
}
.participant:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.participant-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-primary-guest {
  font-size: 0.65rem;
  background: var(--color-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.toggle-presenza {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.toggle-presenza label {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: all .15s;
}
.toggle-presenza input { display: none; }
.toggle-presenza input:checked + span { color: inherit; }
.toggle-presenza .opt-si input:checked ~ label,
.toggle-presenza label.checked-si { background: #eaf3ea; border-color: var(--color-success); color: var(--color-success); }
.toggle-presenza label.checked-no { background: #f7e9e7; border-color: var(--color-danger); color: var(--color-danger); }

.detail-fields { display: none; }
.detail-fields.show { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: translateY(0);} }

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-bottom: 5px;
  font-weight: 500;
}
select, textarea, input[type=text], input[type=email], input[type=tel] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: #fff;
  color: var(--color-text);
}
select:focus, textarea:focus, input:focus {
  outline: none;
  border-color: var(--color-primary);
}
textarea { resize: vertical; min-height: 60px; }

.meal-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.meal-options label {
  text-align: center;
  padding: 10px 4px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--color-muted);
}
.meal-options input { display: none; }
.meal-options label.checked { background: #fceee6; border-color: var(--color-primary); color: var(--color-wine); font-weight: 600; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.btn:active, .btn:hover { background: var(--color-wine); }
.btn-outline {
  background: transparent;
  color: var(--color-wine);
  border: 1.5px solid var(--color-primary);
}

.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-success { background: #eaf3ea; color: #3f6b45; }
.alert-danger { background: #f7e9e7; color: #8f3a32; }
.alert-info { background: #eaf1f5; color: #35657d; }

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-confermato { background: #eaf3ea; color: #3f6b45; }
.status-in_attesa { background: #f7f0e3; color: #96742c; }

/* ---- Timeline ---- */
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: #fceee6;
  color: var(--color-wine);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-time { font-size: 0.78rem; color: var(--color-primary); font-weight: 700; letter-spacing: .5px; }
.timeline-title { font-weight: 600; margin: 2px 0 3px; }
.timeline-desc { font-size: 0.87rem; color: var(--color-muted); }

/* ---- IBAN box ---- */
.iban-box {
  background: #fceee6;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}
.iban-code {
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
  word-break: break-all;
  border: 1px dashed var(--color-primary);
}
.copy-btn {
  background: none;
  border: 1px solid var(--color-primary);
  color: var(--color-wine);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
}

/* ---- Bottom nav (mobile) ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.bottom-nav a {
  text-decoration: none;
  color: var(--color-muted);
  text-align: center;
  font-size: 0.68rem;
  flex: 1;
  padding: 4px;
}
.bottom-nav a .icon { font-size: 1.25rem; display: block; margin-bottom: 2px; }
.bottom-nav a.active { color: var(--color-primary-dark); font-weight: 600; }

.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-title .icon { font-size: 1.3rem; }

.info-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.info-row:last-child { border-bottom: none; }
.info-row .icon { width: 26px; flex-shrink: 0; text-align: center; }

@media (min-width: 700px) {
  .bottom-nav { border-radius: 0; }
}

/* ================================================================
   SEZIONE FOTO — Stili pagina invitato
   ================================================================ */

/* Upload card */
.foto-upload-card { overflow: hidden; }

/* ---- Drop Zone ---- */
.drop-zone {
  border: 2.5px dashed var(--color-primary);
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: #fdf4ef;
  transition: background .2s, border-color .2s, transform .15s;
  user-select: none;
  position: relative;
}
.drop-zone:hover, .drop-zone:focus {
  background: #f9ede4;
  border-color: var(--color-primary-dark);
  outline: none;
}
.drop-zone.drag-over {
  background: #f3e0d4;
  border-color: var(--color-primary-dark);
  transform: scale(1.01);
}
.drop-zone-icon { font-size: 2.4rem; margin-bottom: 8px; line-height: 1; }
.drop-zone-text { font-weight: 600; color: var(--color-primary-dark); font-size: 1rem; margin-bottom: 4px; }
.drop-zone-sub { font-size: 0.83rem; color: var(--color-muted); }
.drop-zone-link { color: var(--color-primary); text-decoration: underline; cursor: pointer; }

/* ---- Upload Queue ---- */
.upload-queue { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.queue-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fdf4ef;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  animation: slideIn .2s ease;
}
.queue-item-error { background: #fdf0ef; border-color: #e8b4b0; }
@keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.queue-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.queue-info { flex: 1; min-width: 0; }
.queue-name { font-size: 0.83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-size { font-size: 0.75rem; color: var(--color-muted); margin-bottom: 5px; }
.queue-status { font-size: 0.78rem; margin-top: 4px; }

/* Progress bar */
.progress-wrap { background: #e9ddd3; border-radius: 20px; height: 5px; overflow: hidden; margin-bottom: 2px; }
.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 20px;
  width: 0%;
  transition: width .2s linear;
}

/* ---- Photo Grid ---- */
.foto-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}
@media (min-width: 480px) { .foto-grid { grid-template-columns: repeat(3, 1fr); } }

.foto-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform .2s, box-shadow .2s;
  animation: fadeIn .3s ease;
}
.foto-item:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(60,30,10,.1); }

.foto-thumb-wrap { position: relative; aspect-ratio: 1; overflow: hidden; background: #f3e6dc; }
.foto-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.foto-item:hover .foto-thumb { transform: scale(1.04); }

.foto-overlay {
  position: absolute;
  inset: 0;
  background: rgba(61, 50, 41, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity .2s;
}
.foto-item:hover .foto-overlay { opacity: 1; }

.foto-btn-zoom, .foto-btn-del {
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, background .15s;
}
.foto-btn-zoom:hover { transform: scale(1.15); }
.foto-btn-del:hover { background: #f7e9e7; transform: scale(1.15); }

.foto-caption {
  font-size: 0.75rem;
  color: var(--color-muted);
  padding: 6px 8px;
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Empty State ---- */
.foto-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.foto-empty-icon { font-size: 3rem; margin-bottom: 10px; }

/* ---- Photo Count Badge ---- */
.photo-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 20px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 12, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 201;
}
.lightbox-close:hover { background: rgba(255,255,255,0.28); }
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  object-fit: contain;
}
.lightbox-caption {
  color: rgba(255,255,255,.75);
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
  max-width: 480px;
}

