/* Tome & Susi — botanico elegante: salvia, crema, oro. */

:root {
  --salvia: #7c8a6e;
  --verde: #3d4a38;
  --verde-scuro: #2b3527;
  --crema: #faf7f0;
  --crema-scura: #f1ebdd;
  --oro: #b3925a;
  --oro-chiaro: #d3b98a;
  --testo: #3a3a33;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--testo);
  background: var(--crema);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }

/* ---------- copertina ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-foto {
  position: absolute; inset: 0;
  /* il tono caldo è già nell'immagine: niente filter/transform, che su
     alcuni telefoni costano cari in rendering */
  background: url("../img/copertina.jpg") center 32% / cover no-repeat;
}
.hero-velo {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(43,53,39,.38) 0%, rgba(43,53,39,.72) 100%),
    linear-gradient(to top, rgba(43,53,39,.82), rgba(43,53,39,.3) 45%, rgba(43,53,39,.5));
}
.hero-testo {
  position: relative;
  padding: 2rem 1.2rem;
  color: var(--crema);
  text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 3px 18px rgba(0,0,0,.6);
  max-width: 46rem;
}
.hero-kicker {
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: .9rem;
  font-weight: 600;
  color: var(--crema);
}
.hero-nomi {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.2rem, 10vw, 6rem);
  margin: .4rem 0 0;
}
.amp { color: var(--oro-chiaro); }
.hero-riga { margin: .3rem 0 .6rem; color: var(--oro-chiaro); font-size: 1.3rem; }
.hero-riga::before, .hero-riga::after {
  content: "";
  display: inline-block;
  width: 4.5rem; height: 1px;
  background: var(--oro-chiaro);
  vertical-align: middle;
  margin: 0 .8rem;
  opacity: .8;
}
.hero-data { font-size: 1.5rem; font-style: italic; font-weight: 600; }

.countdown {
  display: flex; justify-content: center; gap: 1rem;
  margin: 1.6rem 0 1.8rem;
}
/* niente backdrop-filter in tutto il foglio: su alcuni Chromium
   rompe il painting dell'intera pagina sotto la copertina */
.cd {
  min-width: 4.6rem;
  padding: .6rem .4rem;
  border: 1px solid rgba(211,185,138,.55);
  border-radius: .4rem;
  background: rgba(43,53,39,.45);
}
.cd span { display: block; font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.cd small { letter-spacing: .12em; text-transform: uppercase; font-size: .62rem; }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .75rem 1.8rem;
  border-radius: 2rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.btn-oro { background: var(--oro); color: #fff; }
.btn-chiaro { background: transparent; color: inherit; border-color: currentColor; }
.btn-grande { font-size: 1.15rem; padding: .9rem 2.6rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- menu ---------- */
.menu {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: center; gap: clamp(.8rem, 4vw, 2.6rem);
  padding: .8rem 1rem;
  background: rgba(250,247,240,.96);
  border-bottom: 1px solid var(--crema-scura);
  flex-wrap: wrap;
}
.menu a {
  color: var(--verde);
  text-decoration: none;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .85rem;
}
.menu a:hover { color: var(--oro); }

/* ---------- sezioni ---------- */
.sez { padding: 4.5rem 1.2rem; max-width: 60rem; margin: 0 auto; }
.sez-verde {
  max-width: none;
  background: linear-gradient(180deg, var(--crema-scura), #ece4d2);
}
.sez-verde > * { max-width: 60rem; margin-left: auto; margin-right: auto; }
.sez h2 {
  text-align: center;
  font-weight: 500;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  color: var(--verde);
  margin-bottom: .4rem;
}
.fiore { color: var(--oro); font-size: .8em; vertical-align: .12em; }
.sottotitolo { text-align: center; font-style: italic; font-size: 1.2rem; margin-bottom: 2.2rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; max-width: 34rem; margin: 0 auto; }
.timeline li {
  display: flex; gap: 1.2rem;
  padding: 1.1rem 0 1.1rem 1.4rem;
  border-left: 2px solid var(--oro-chiaro);
  position: relative;
}
.timeline li::before {
  content: "\2740";
  position: absolute; left: -.72rem; top: 1.15rem;
  color: var(--oro);
  background: var(--crema);
  line-height: 1;
}
.ora {
  min-width: 5.4rem;
  font-weight: 600;
  color: var(--verde);
  font-variant-numeric: tabular-nums;
}

.nota-costume {
  max-width: 34rem;
  margin: 2rem auto 0;
  text-align: center;
  background: #fff;
  border: 1px solid var(--oro-chiaro);
  border-radius: .6rem;
  padding: 1rem 1.2rem;
  font-size: 1.15rem;
}

/* ---------- luogo ---------- */
.luogo-azioni { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.luogo-note { max-width: 36rem; margin: 0 auto; text-align: center; }
.luogo-note p { margin-bottom: .8rem; }

/* ---------- upload ---------- */
.avviso-wa {
  display: flex; gap: .9rem; align-items: center;
  max-width: 34rem; margin: 0 auto 2rem;
  background: #fff;
  border: 1px solid var(--oro-chiaro);
  border-radius: .6rem;
  padding: 1rem 1.2rem;
}
.avviso-icona { font-size: 1.6rem; color: var(--oro); }
.upload-box { max-width: 34rem; margin: 0 auto; display: grid; gap: 1.1rem; text-align: center; }
.campo { display: grid; gap: .3rem; text-align: left; }
.campo span { font-size: .95rem; letter-spacing: .05em; }
.campo small { color: #7a7a70; }
.campo input {
  font-family: var(--serif);
  font-size: 1.15rem;
  padding: .7rem .9rem;
  border: 1px solid #cfc8b6;
  border-radius: .45rem;
  background: #fff;
  width: 100%;
}
.campo input:focus { outline: 2px solid var(--oro-chiaro); border-color: var(--oro); }
.dropzone {
  border: 2px dashed var(--salvia);
  border-radius: .8rem;
  background: #fff;
  padding: 2.2rem 1rem;
  cursor: pointer;
  display: grid; gap: .5rem; justify-items: center;
  transition: background .15s, border-color .15s;
}
.dropzone.trascina, .dropzone:hover { background: #f4f7ef; border-color: var(--verde); }
.dropzone input { display: none; }
.dz-icona { font-size: 2.2rem; }
.lista-file {
  text-align: left; font-size: .95rem;
  background: #fff; border-radius: .5rem;
  padding: .8rem 1rem; border: 1px solid var(--crema-scura);
  max-height: 11rem; overflow-y: auto;
}
.scelta-gallery {
  border: 1px solid var(--crema-scura);
  border-radius: .6rem;
  background: #fff;
  padding: 1rem 1.2rem;
  display: grid;
  gap: .8rem;
  text-align: left;
}
.scelta-gallery legend {
  padding: 0 .5rem;
  font-size: .95rem;
  letter-spacing: .05em;
  color: var(--verde);
}
.scelta { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; }
.scelta input { margin-top: .45rem; accent-color: var(--oro); width: 1.1rem; height: 1.1rem; }
.scelta small { color: #7a7a70; }

.barra { height: .7rem; border-radius: 1rem; background: var(--crema-scura); overflow: hidden; }
.barra-riempi { height: 100%; width: 0; background: linear-gradient(90deg, var(--salvia), var(--oro)); transition: width .2s; }
.esito { min-height: 1.4rem; font-style: italic; }
.esito.ok { color: var(--verde); }
.esito.errore, .errore { color: #a03d2e; }

/* ---------- carosello ---------- */
.carosello-riquadro { position: relative; max-width: 60rem; margin: 0 auto; }
.carosello {
  display: flex; gap: .8rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: .3rem .2rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--oro-chiaro) transparent;
}
.car-tessera {
  flex: 0 0 auto;
  scroll-snap-align: center;
  height: min(52vw, 340px);
  border-radius: .6rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(43,53,39,.18);
  background: #fff;
  padding: .35rem;
}
.car-tessera img { height: 100%; width: auto; border-radius: .4rem; }
.car-freccia {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5;
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--oro-chiaro);
  background: rgba(250,247,240,.92);
  color: var(--verde);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.car-freccia:hover { background: var(--oro-chiaro); }
.car-prec { left: -.4rem; }
.car-succ { right: -.4rem; }

/* ---------- griglia (area sposi) ---------- */
.griglia {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .8rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}
.tessera { border-radius: .5rem; overflow: hidden; background: #fff; box-shadow: 0 3px 10px rgba(43,53,39,.14); }
.tessera img { width: 100%; height: 160px; object-fit: cover; }
.segnaposto {
  height: 160px; display: flex; align-items: center; justify-content: center;
  background: var(--crema-scura); font-size: 1rem; color: var(--verde);
}

/* ---------- fondo ---------- */
.fondo {
  background: var(--verde-scuro);
  color: var(--crema);
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.fondo-nomi { font-family: var(--script); font-size: 2.4rem; margin-bottom: .3rem; }
.fondo-mini { margin-top: 1.4rem; font-size: .85rem; opacity: .55; }
.fondo-mini a { color: inherit; }

/* ---------- area sposi ---------- */
.admin { padding: 2rem 1rem; }
.admin-login {
  max-width: 24rem; margin: 8vh auto; text-align: center;
  background: #fff; border: 1px solid var(--crema-scura);
  border-radius: .8rem; padding: 2.4rem 2rem;
  box-shadow: 0 8px 30px rgba(43,53,39,.12);
}
.admin-login h1 { font-weight: 500; color: var(--verde); margin-bottom: 1.2rem; }
.admin-login form { display: grid; gap: 1rem; margin-top: 1rem; }
.admin-testata { text-align: center; margin-bottom: 2rem; }
.admin-testata h1 { font-weight: 500; color: var(--verde); }
.admin-tessera { position: relative; }
.conta-sel { margin-top: .8rem; font-style: italic; color: var(--salvia); }
.sel-file { width: 1.15rem; height: 1.15rem; accent-color: var(--oro); cursor: pointer; }
.admin-tessera:has(.sel-file:checked) { outline: 3px solid var(--oro); outline-offset: -3px; }
.admin-azioni {
  display: flex; justify-content: space-between; align-items: center;
  padding: .35rem .6rem; font-size: .9rem;
}
.admin-azioni a { text-decoration: none; color: var(--verde); font-size: 1.1rem; }
.admin-azioni button {
  border: 0; background: none; color: #a03d2e; cursor: pointer; font-size: 1rem;
}

/* ================= logo dell'evento ================= */
.logo-evento { display: block; margin: 0 auto; }
.logo-hero { width: clamp(120px, 22vw, 170px); margin-bottom: .8rem; }
.logo-fondo { width: 110px; margin-bottom: 1rem; }
.logo-anello {
  fill: none;
  stroke: var(--oro-chiaro);
  stroke-width: 1.2;
  stroke-dasharray: 660;
  stroke-dashoffset: 660;
  animation: logo-disegna 2.2s ease .4s forwards;
}
.logo-lineetta {
  stroke: var(--oro-chiaro);
  stroke-width: 1;
  opacity: 0;
  animation: logo-appari .9s ease 1.1s forwards;
}
.logo-monogramma {
  font-family: var(--script);
  font-size: 3.4rem;
  fill: currentColor;
}
.logo-data {
  font-family: var(--serif);
  font-size: .82rem;
  letter-spacing: .35em;
  fill: var(--oro-chiaro);
}
.logo-monogramma, .logo-data { opacity: 0; animation: logo-appari .9s ease 1.3s forwards; }
.hero .logo-evento { color: var(--crema); animation: levita 6s ease-in-out 2s infinite alternate; }
.fondo .logo-evento { color: var(--crema); }
@keyframes logo-disegna { to { stroke-dashoffset: 0; } }
@keyframes logo-appari { to { opacity: 1; } }
@keyframes levita { from { transform: translateY(0); } to { transform: translateY(-7px); } }

/* ================= ingresso della copertina ================= */
@keyframes salita { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.hero-testo > * { animation: salita .9s cubic-bezier(.22, .8, .3, 1) both; }
.hero-testo > :nth-child(1) { animation-delay: .15s; }
.hero-testo > :nth-child(2) { animation-delay: .45s; }
.hero-testo > :nth-child(3) { animation-delay: .65s; }
.hero-testo > :nth-child(4) { animation-delay: .9s; }
.hero-testo > :nth-child(5) { animation-delay: 1.05s; }
.hero-testo > :nth-child(6) { animation-delay: 1.25s; }
.hero-testo > :nth-child(7) { animation-delay: 1.5s; }

/* ================= petali che cadono ================= */
.petali { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.petalo {
  position: absolute;
  top: -5%;
  border-radius: 68% 4% 68% 4%;
  opacity: 0;
  will-change: transform;
  animation: petalo-cade linear infinite;
}
@keyframes petalo-cade {
  0%   { transform: translate3d(0, -6vh, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: .85; }
  70%  { opacity: .7; }
  100% { transform: translate3d(6vw, 108vh, 0) rotate(340deg); opacity: 0; }
}

/* ================= sezioni che si rivelano ================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.22, .8, .3, 1); }
.reveal.in-vista { opacity: 1; transform: none; }
.sez h2 .fiore { display: inline-block; }
.reveal.in-vista .fiore { animation: fiore-gira 1.1s cubic-bezier(.34, 1.4, .5, 1) both; }
@keyframes fiore-gira { from { transform: rotate(-200deg) scale(0); } to { transform: none; } }
.sez { scroll-margin-top: 4.2rem; }

/* ================= dettagli vivi ================= */
.cd span.pop { animation: cd-pop .45s ease; }
@keyframes cd-pop { 35% { transform: scale(1.14); color: var(--oro-chiaro); } }

.menu a { position: relative; }
.menu a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--oro);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.menu a:hover::after { transform: scaleX(1); }

.btn-oro { position: relative; overflow: hidden; }
.btn-oro::after {
  content: "";
  position: absolute; top: 0; left: -80%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn-oro:hover::after { left: 130%; }

.car-tessera { transition: transform .35s ease, box-shadow .35s ease; }
.car-tessera:hover { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 10px 24px rgba(43,53,39,.28); }
.car-tessera img { transition: transform .5s ease; }
.car-tessera:hover img { transform: scale(1.03); }

.dropzone .dz-icona { display: inline-block; transition: transform .3s ease; }
.dropzone:hover .dz-icona, .dropzone.trascina .dz-icona { transform: scale(1.15) rotate(-6deg); }

/* Chi preferisce meno movimento: tutto fermo e visibile */
@media (prefers-reduced-motion: reduce) {
  .hero-testo > *, .logo-anello, .logo-lineetta, .hero .logo-evento,
  .logo-monogramma, .logo-data,
  .cd span.pop, .reveal.in-vista .fiore { animation: none !important; }
  .logo-anello { stroke-dashoffset: 0; }
  .logo-lineetta, .logo-monogramma, .logo-data { opacity: 1; }
  .petali { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 560px) {
  .countdown { gap: .5rem; }
  .cd { min-width: 3.7rem; }
  .timeline li { flex-direction: column; gap: .2rem; }
  .car-prec { left: .2rem; }
  .car-succ { right: .2rem; }
}
