/* ---------------------------------------------------------------------------
   Charte du mariage de Francine & Jérémie.
   Bleu acier des faire-part, serif italique pour les titres, sans-serif très
   lisible pour tout le reste. Taille de base volontairement grande : une
   partie des invités a plus de 70 ans et lira ça sur un téléphone.
   --------------------------------------------------------------------------- */

:root {
  --blue-deep:  #27546F;
  --blue:       #4A7FA5;
  --blue-soft:  #7FA8C4;
  --blue-line:  #C8DBEA;
  --blue-pale:  #DCE8F3;
  --blue-bg:    #EFF5FA;
  --gold:       #C0972F;
  --mauve:      #A5709C;
  --green:      #3E8A62;
  --red:        #B4544C;
  --white:      #FFFFFF;
  --ink:        #24404F;
  --ink-soft:   #5C7788;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius: 16px;
  --shadow: 0 2px 20px rgba(39, 84, 111, 0.10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 48px;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -180px, #FFFFFF 0%, rgba(255,255,255,0) 70%),
    var(--blue-bg);
  min-height: 100vh;
}

/* --- En-tête ------------------------------------------------------------- */
.site-header {
  text-align: center;
  padding: 34px 20px 26px;
  color: var(--blue-deep);
}

.ornament { color: var(--blue-soft); }
.ornament svg { width: 150px; height: 30px; display: block; margin: 0 auto 10px; }

.site-header h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(38px, 10vw, 60px);
  line-height: 1.1;
  margin: 0;
  color: var(--blue-deep);
}

.subtitle {
  font-family: var(--serif);
  font-size: clamp(19px, 4.6vw, 23px);
  color: var(--blue);
  margin: 8px 0 0;
  font-style: italic;
}

/* --- Structure ----------------------------------------------------------- */
.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 18px;
}

.wrap-wide { max-width: 1180px; }

.card {
  background: var(--white);
  border: 1px solid var(--blue-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  margin-bottom: 20px;
}

/* --- Étapes -------------------------------------------------------------- */
.step { margin-bottom: 34px; }
.step:last-of-type { margin-bottom: 8px; }

.step-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
}

.num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-deep);
  color: var(--white);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-head h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  font-weight: 600;
  color: var(--blue-deep);
  margin: 0;
  line-height: 1.15;
}

.help {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 10px 2px 0;
}

/* --- Champ nom ----------------------------------------------------------- */
#uploaderName {
  width: 100%;
  /* 18px minimum : en dessous de 16px, iOS zoome tout seul au clic et
     décale la mise en page sous les doigts de l'utilisateur. */
  font-size: 19px;
  font-family: var(--sans);
  padding: 16px 16px;
  border: 2px solid var(--blue-line);
  border-radius: 12px;
  background: #FBFDFF;
  color: var(--ink);
  min-height: 60px;
}

#uploaderName:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}

/* --- Gros boutons -------------------------------------------------------- */
.big-choice, .big-send, .big-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  border-radius: 14px;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  padding: 14px 18px;
  -webkit-tap-highlight-color: transparent;
}

.big-choice {
  background: var(--blue-pale);
  border: 2px dashed var(--blue-soft);
  color: var(--blue-deep);
}

.big-choice svg { width: 30px; height: 30px; flex-shrink: 0; }
.big-choice:active { background: #CFE0EF; }

.big-send {
  background: var(--blue-deep);
  border: 2px solid var(--blue-deep);
  color: var(--white);
  margin-top: 4px;
}

.big-send:active { background: #1D4358; }

.big-send:disabled {
  background: var(--blue-line);
  border-color: var(--blue-line);
  color: #8AA6B8;
  cursor: default;
}

.big-ghost {
  background: transparent;
  border: 2px solid var(--blue-line);
  color: var(--blue-deep);
  margin-top: 12px;
  font-size: 19px;
  min-height: 60px;
}

/* --- Liste des fichiers choisis ------------------------------------------ */
.file-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  background: #F7FAFD;
  border: 1px solid var(--blue-line);
  border-radius: 12px;
  padding: 10px 12px;
}

.file-list .preview {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--blue-pale);
}

.file-list .preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--blue);
}

.file-list .info { flex: 1 1 auto; min-width: 0; }

.file-list .fname {
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list .fsize { font-size: 14px; color: var(--ink-soft); }

.file-list .remove {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--blue-line);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.file-list .remove:active { background: #F0F4F8; }

/* --- Progression --------------------------------------------------------- */
.progress-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  color: var(--blue-deep);
  margin: 0 0 4px;
  text-align: center;
}

.progress-warn {
  text-align: center;
  color: var(--mauve);
  font-size: 16px;
  margin: 0 0 20px;
}

.progress-track {
  height: 16px;
  border-radius: 999px;
  background: var(--blue-pale);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-deep) 100%);
  transition: width 0.25s ease;
}

.progress-count {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--blue-deep);
  margin: 12px 0 18px;
}

.progress-list, .done-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-list li, .done-details li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #F7FAFD;
}

.progress-list .fname, .done-details .fname {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.state.waiting { color: var(--ink-soft); }
.state.sending { color: var(--blue); }
.state.ok      { color: var(--green); }
.state.dup     { color: var(--gold); }
.state.bad     { color: var(--red); }

/* --- Écran de fin -------------------------------------------------------- */
.done { text-align: center; }

.check-circle {
  width: 82px;
  height: 82px;
  margin: 4px auto 16px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-circle svg { width: 52px; height: 52px; }

.done h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 38px;
  color: var(--blue-deep);
  margin: 0 0 8px;
}

.done-sub { font-size: 19px; margin: 0 0 20px; color: var(--ink); }

.done-details { margin-bottom: 22px; text-align: left; }

/* --- Divers -------------------------------------------------------------- */
.error-msg {
  background: #FBEEED;
  border: 1px solid #E7C4C0;
  color: var(--red);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 17px;
  margin: 4px 0 0;
}

.foot-note {
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 22px 0 0;
  line-height: 1.7;
}

.foot-link { text-align: center; margin: 18px 0 0; }

.foot-link a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--blue);
}

/* --- Galerie ------------------------------------------------------------- */
.gallery-top { margin: 0 0 22px; }
.gallery-top .big-send { max-width: 420px; margin: 0 auto; }

.empty-card { text-align: center; }

.empty-card h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  color: var(--blue-deep);
  margin: 0 0 6px;
}

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

.tile {
  padding: 0;
  border: 1px solid var(--blue-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--blue-pale);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  display: block;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Visionneuse --------------------------------------------------------- */
.viewer {
  position: fixed;
  inset: 0;
  background: rgba(20, 42, 56, 0.96);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer img {
  max-width: 94vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
}

.viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 88px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
}

.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }

.viewer-caption {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: #E6F0F7;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  margin: 0;
  padding: 0 70px;
}

/* --- Ordinateur ---------------------------------------------------------- */
@media (min-width: 700px) {
  body { font-size: 19px; }
  .card { padding: 34px 34px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .big-choice { min-height: 96px; font-size: 23px; }
  .big-choice svg { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
}
