/* ══════════════════════════════════════════
   RESET & VARIABILI
══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --sugar:        #7fa8b8;
  --sugar-light:  #a8c8d8;
  --sugar-pale:   #d6e8f0;
  --sugar-deep:   #4a7a90;
  --sugar-mist:   #eef5f8;
  --cream:        #f5f1ea;
  --dark:         #1e2e35;
  --muted:        #5a7a87;
  --border:       rgba(127,168,184,0.28);
  --white:        #ffffff;

  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'Jost', system-ui, sans-serif;

  /* spacing mobile-first */
  --px:           1.1rem;
  --section-gap:  2.2rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--sugar-mist);
  font-family: var(--font-sans);
  color: var(--dark);
  overflow-x: hidden;
  /* grain texture */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

img {
  display: block;
  max-width: 100%;
}

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;          /* full screen su mobile */
  max-height: 620px;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(127,168,184,0.15) 0%,
    rgba(238,245,248,0.0)  35%,
    rgba(238,245,248,0.5)  65%,
    var(--sugar-mist)      100%
  );
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 var(--px) 2.8rem;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  color: var(--white);
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(30,46,53,0.5);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-names {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(3rem, 14vw, 5.5rem);
  line-height: 0.9;
  color: var(--white);
  text-shadow: 0 2px 24px rgba(30,46,53,0.3);
  opacity: 0;
  animation: fadeUp 0.9s 0.35s forwards;
}

.hero-names .amp {
  font-style: italic;
  opacity: 0.85;
  font-size: 0.52em;
  display: block;
  margin: 0.15em 0;
}

/* ══════════════════════════════════════════
   SEZIONE CENTRALE
══════════════════════════════════════════ */
.center-section {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--section-gap) var(--px) 1rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.55s forwards;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  max-width: 160px;
  margin: 0 auto 1.4rem;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: var(--sugar);
  opacity: 0.6;
}

.ornament-diamond {
  width: 5px;
  height: 5px;
  background: var(--sugar-deep);
  transform: rotate(45deg);
  opacity: 0.75;
}

.main-phrase {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 4vw, 1.2rem);
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.4rem;
}

.event-date {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  color: var(--dark);
  letter-spacing: 0.02em;
  margin-bottom: 0.8rem;
}

.event-details {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2.1;
}

.event-details strong {
  color: var(--sugar-deep);
  font-weight: 400;
}

/* ══════════════════════════════════════════
   PHOTO STRIP
══════════════════════════════════════════ */
.photo-strip {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 0.35rem;
  padding: var(--section-gap) var(--px) 0;
  opacity: 0;
  animation: fadeUp 0.9s 0.75s forwards;
}

.strip-photo {
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 3px 14px rgba(74,122,144,0.13);
}

.strip-photo:nth-child(1) { aspect-ratio: 3/4; margin-top: 1.2rem; }
.strip-photo:nth-child(2) { aspect-ratio: 2/3; }
.strip-photo:nth-child(3) { aspect-ratio: 3/4; margin-top: 2rem; }

.strip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.85) brightness(0.95);
  transition: transform 0.5s ease;
}

.strip-photo:active img {
  transform: scale(1.04);
}

.photo-caption {
  text-align: center;
  margin-top: 1.2rem;
  padding: 0 var(--px);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--muted);
  opacity: 0.8;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════
   UPLOAD SECTION
══════════════════════════════════════════ */
.upload-section {
  padding: var(--section-gap) var(--px) 5rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.95s forwards;
}

.upload-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.6rem 1.3rem;
  box-shadow:
    0 2px 20px rgba(74,122,144,0.08),
    0 0 0 1px rgba(127,168,184,0.06);
}

/* card heading */
.card-heading {
  text-align: center;
  margin-bottom: 1.4rem;
}

.card-heading-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sugar);
  margin-bottom: 0.3rem;
}

.card-heading-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--dark);
}

/* drop zone */
.drop-zone {
  border: 1.5px dashed var(--sugar-light);
  border-radius: 3px;
  padding: 2.2rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  background: var(--sugar-mist);
  position: relative;
  overflow: hidden;
  /* touch feedback */
  -webkit-user-select: none;
  user-select: none;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(127,168,184,0.1) 0%, transparent 65%);
  pointer-events: none;
}

.drop-zone:active {
  background: var(--sugar-pale);
  border-color: var(--sugar);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 0; /* evita zoom su iOS */
}

.drop-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
  display: block;
  pointer-events: none;
}

.drop-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--dark);
  margin-bottom: 0.2rem;
  pointer-events: none;
}

.drop-hint {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--muted);
  pointer-events: none;
}

/* preview grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.4rem;
  margin-top: 1rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  background: var(--sugar-pale);
  animation: scaleIn 0.25s ease;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(30,46,53,0.72);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  /* touch target minimo 44px con padding virtuale */
  padding: 0;
}

.remove-btn:active {
  background: rgba(30,46,53,0.95);
}

.video-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--sugar-pale);
  flex-direction: column;
  gap: 0.2rem;
}

.video-thumb span {
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: var(--font-sans);
}

/* fields */
.field-group {
  margin-top: 1.1rem;
}

.field-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.8rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px su mobile evita zoom iOS */
  font-weight: 300;
  color: var(--dark);
  background: var(--sugar-mist);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus {
  border-color: var(--sugar);
  background: var(--white);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

/* progress */
.progress-wrap {
  margin-top: 1.2rem;
  display: none;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progress-bar-bg {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sugar-light), var(--sugar-deep));
  border-radius: 1px;
  transition: width 0.3s ease;
  width: 0%;
}

/* error */
.error-msg {
  margin-top: 0.9rem;
  padding: 0.7rem 1rem;
  background: var(--sugar-mist);
  border: 1px solid var(--sugar-light);
  border-radius: 3px;
  font-size: 0.78rem;
  color: var(--sugar-deep);
  display: none;
  line-height: 1.5;
}

/* submit button */
.submit-btn {
  display: block;
  width: 100%;
  margin-top: 1.2rem;
  padding: 1rem;
  background: var(--sugar-deep);
  color: var(--white);
  border: none;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  /* minimo touch target */
  min-height: 52px;
  -webkit-appearance: none;
  appearance: none;
}

.submit-btn:active {
  opacity: 0.85;
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* success */
.success-panel {
  display: none;
  text-align: center;
  padding: 2rem 0;
  animation: fadeUp 0.6s ease;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.success-text {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 0 var(--px) 2.5rem;
  font-size: 0.63rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  color: var(--sugar);
  text-transform: uppercase;
  opacity: 0.65;
}

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

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

/* ══════════════════════════════════════════
   DESKTOP (tablet in su)
══════════════════════════════════════════ */
@media (min-width: 640px) {
  :root {
    --px: 2rem;
    --section-gap: 3rem;
  }

  .hero { max-height: 700px; }

  .hero-content {
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 3rem;
    text-align: center;
  }

  .upload-section {
    max-width: 580px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
  }

  .upload-card { padding: 2.5rem; }

  .photo-strip { max-width: 700px; margin: 0 auto; gap: 0.5rem; }

  .strip-photo:hover img { transform: scale(1.05); }
  .strip-photo img { transition: transform 0.6s ease; }

  .drop-zone:hover {
    background: var(--sugar-pale);
    border-color: var(--sugar);
  }

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