/* ══════════════════════════════════════════════════════════════
   upload-styles.css — Stili specifici per /upload.html
   Mobile-first. Riusa variabili CSS da styles.css.
   ══════════════════════════════════════════════════════════════ */

/* ── Reset body per la pagina upload ───────────────────────── */
.upload-body {
  min-height: 100vh;
  background: var(--bg-warm);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.5rem 3rem;
}

/* ── Container principale ──────────────────────────────────── */
.upload-container {
  width: 100%;
  max-width: 480px;
  position: relative;
}

/* ── Banner beta test ─────────────────────────────────────── */
.beta-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fef9c3;
  border: 1px solid #fde68a;
  color: #78350f;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.beta-banner-close {
  background: none;
  border: none;
  color: #92400e;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.beta-banner-close:hover {
  color: #78350f;
}

/* ── Error banner globale ──────────────────────────────────── */
.error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 10px;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: stepFadeSlide 0.25s ease;
}

/* ── Step container ────────────────────────────────────────── */
.step {
  display: none;
  text-align: center;
}

/* Step visibile + animazione fade-in/slide-up */
.step.step-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: stepFadeSlide 0.3s ease both;
}

@keyframes stepFadeSlide {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Logo cuore ────────────────────────────────────────────── */
.heart-logo {
  font-size: 3.75rem;        /* ~60px su mobile */
  color: var(--primary-color);
  margin-bottom: 1.25rem;
  line-height: 1;
}

/* Animazione sparkle sul cuore (step 1 e step 4) */
.heart-sparkle {
  animation: heartSparkle 2s ease-in-out infinite;
}

@keyframes heartSparkle {
  0%, 100% { transform: scale(1);    color: var(--primary-color); }
  50%       { transform: scale(1.15); color: var(--primary-dark);  }
}

/* ── Tipografia heading ────────────────────────────────────── */
.step h1,
.step h2 {
  font-family: var(--font-serif);
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.step h1 { font-size: 1.9rem; }
.step h2 { font-size: 1.6rem; }

.step-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* ── STEP 1 — Input nome ───────────────────────────────────── */
.name-input-wrap {
  width: 100%;
  margin-bottom: 1.5rem;
}

.name-input-wrap input[type="text"] {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--separator);
  border-radius: 12px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.name-input-wrap input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(95, 127, 113, 0.15);
}

.input-hint {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* ── STEP 2 — Bottoni upload tipo ──────────────────────────── */
.upload-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin: 1.25rem 0 1.5rem;
}

.btn-upload-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 64px;
  padding: 1rem 2rem;
  border: 1.5px solid var(--separator);
  border-radius: 14px;
  background: var(--white);
  color: var(--text-dark);
  font-size: 1.1rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  box-shadow: var(--shadow);
}

.btn-upload-type:hover,
.btn-upload-type:focus-visible {
  border-color: var(--primary-color);
  background: rgba(95, 127, 113, 0.06);
  transform: translateY(-2px);
  outline: none;
}

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

.upload-type-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.upload-counter {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* ── STEP 3 — Progress ─────────────────────────────────────── */
.files-progress {
  width: 100%;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.progress-row {
  background: var(--white);
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.progress-row.has-error {
  border-color: #fca5a5;
  background: #fef9f9;
}

.progress-file-name {
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.progress-bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.progress-bar-wrap {
  flex: 1;
  height: 7px;
  background: var(--separator);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  transition: width 0.25s ease;
}

.progress-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 2.5rem;
  text-align: right;
}

.progress-status.done {
  color: var(--primary-color);
  font-size: 1rem;
}

.error-inline {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #b91c1c;
}

.btn-retry {
  margin-top: 0.5rem;
  padding: 0.3rem 0.8rem;
  background: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-retry:hover {
  background: var(--primary-color);
  color: var(--white);
}

.progress-summary {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ── Spinner / stato upload (single upload, no progress fluida) */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--bg-warm, #f5e6d3);
  border-top-color: var(--primary-color, #5a7d6f);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.progress-checkmark {
  width: 24px;
  height: 24px;
  color: #5a7d6f;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.progress-error {
  width: 24px;
  height: 24px;
  color: #c54343;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── STEP 4 — Successo ─────────────────────────────────────── */
.success-count {
  font-size: 1.05rem;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.success-hint {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.75rem;
  font-style: italic;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

/* ── Bottoni globali ───────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(63, 94, 82, 0.25);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(63, 94, 82, 0.3);
  outline: none;
  color: var(--white);
}

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

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 1rem 2rem;
  background: transparent;
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  border-radius: 12px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  outline: none;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

.btn-link:hover {
  color: var(--primary-color);
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.5rem 1.1rem;
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--separator);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-back-home:hover,
.btn-back-home:focus-visible {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: rgba(95, 127, 113, 0.06);
  outline: none;
}

/* ── Desktop ≥ 600px ───────────────────────────────────────── */
@media (min-width: 600px) {
  .upload-body {
    padding: 3rem 2rem 4rem;
    align-items: center;
    min-height: 100vh;
  }

  .heart-logo {
    font-size: 5rem;          /* ~80px su desktop */
    margin-bottom: 1.5rem;
  }

  .step h1 { font-size: 2.25rem; }
  .step h2 { font-size: 1.9rem;  }

  .upload-buttons {
    flex-direction: row;
    gap: 1rem;
  }

  .btn-upload-type {
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 110px;
  }

  .upload-type-icon {
    font-size: 2rem;
  }

  .success-actions {
    flex-direction: row;
  }
}

/* ── Step status (before/after periodo matrimonio) ── */
.upload-status-icon {
  font-size: 64px;
  margin-bottom: 20px;
  line-height: 1;
}

#step-status h2 {
  margin-bottom: 12px;
  color: #333;
}

#step-status p {
  color: #666;
  margin-bottom: 24px;
}
