:root {
  color-scheme: light dark;
  --accent: #7c5cff;
  --accent-fonce: #6647e0;
  --fond: #0f0f14;
  --fond-carte: #1a1a22;
  --texte: #f0f0f5;
  --texte-attenue: #9a9aa8;
  --bordure: #33333e;
  --danger: #ff6b6b;
  --danger-fond: rgba(255, 107, 107, 0.1);
}

:root[data-theme="light"] {
  --fond: #f7f7fb;
  --fond-carte: #ffffff;
  --texte: #17171f;
  --texte-attenue: #64646f;
  --bordure: #e0e0e8;
  --danger-fond: rgba(255, 107, 107, 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --fond: #f7f7fb;
    --fond-carte: #ffffff;
    --texte: #17171f;
    --texte-attenue: #64646f;
    --bordure: #e0e0e8;
    --danger-fond: rgba(255, 107, 107, 0.12);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--fond);
  color: var(--texte);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(1.25rem, 5vw, 3rem) 1.25rem 3rem;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.sous-titre {
  color: var(--texte-attenue);
  margin-top: 0;
}

.etape-email {
  margin-bottom: 1rem;
}

.etape-email label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.etape-email input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--bordure);
  background: var(--fond-carte);
  color: var(--texte);
  font-size: 1rem;
  min-height: 44px;
}

.etape-email input:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.etape-email .detail {
  margin: 0.35rem 0 0;
}

.quota {
  font-size: 0.9rem;
  color: var(--texte-attenue);
  margin-bottom: 1.25rem;
}

.etape-verification {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}

.etape-verification p {
  margin: 0 0 0.7rem;
}

.etape-verification .detail {
  font-size: 0.85rem;
  color: var(--texte-attenue);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.bloc-code {
  display: flex;
  gap: 0.5rem;
}

.bloc-code input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--bordure);
  background: var(--fond);
  color: var(--texte);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  min-height: 44px;
}

.bloc-code button {
  padding: 0 1.1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

#bouton-envoyer-code {
  border: none;
  cursor: pointer;
  font: inherit;
}

#bouton-envoyer-code:disabled,
.bloc-code button:disabled {
  background: var(--bordure);
  color: var(--texte-attenue);
  cursor: not-allowed;
}

.confirmation {
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid #34c759;
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  margin-bottom: 1.25rem;
}

.banniere-quota-epuise {
  background: var(--danger-fond);
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}

.banniere-quota-epuise p {
  margin: 0 0 0.7rem;
}

.grille-packs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

@media (min-width: 560px) {
  .grille-packs {
    flex-direction: row;
  }
}

.carte-pack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.9rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--bordure);
  background: var(--fond-carte);
  color: var(--texte);
  cursor: pointer;
  font: inherit;
  min-height: 44px;
}

.carte-pack:hover:not(:disabled) {
  border-color: var(--accent);
}

.carte-pack:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.carte-pack.recommande {
  border-color: var(--accent);
  border-width: 2px;
}

.pack-nom {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pack-detail {
  font-size: 0.85rem;
  color: var(--texte-attenue);
}

.pack-prix {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.etape {
  margin-bottom: 1.75rem;
}

.zone-depot {
  border: 2px dashed var(--bordure);
  border-radius: 12px;
  padding: 2.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.zone-depot-compacte {
  padding: 1.5rem 1.25rem;
}

.zone-depot p { margin: 0; }

.zone-depot .detail {
  font-size: 0.8rem;
  color: var(--texte-attenue);
  margin-top: 0.4rem;
}

.zone-depot:hover,
.zone-depot.survol,
.zone-depot:focus-visible {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.08);
  outline: none;
}

.zone-depot.rempli {
  border-style: solid;
  border-color: var(--accent);
}

.liste-fichiers {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--texte-attenue);
}

.liste-fichiers li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--bordure);
}

.liste-fichiers li:last-child { border-bottom: none; }

.liste-fichiers button {
  background: none;
  border: none;
  color: var(--texte-attenue);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.liste-fichiers button:hover { color: var(--danger); }

.detail {
  font-size: 0.8rem;
  color: var(--texte-attenue);
}

button[type="submit"]#bouton-generer {
  width: 100%;
  padding: 0.95rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}

button#bouton-generer:disabled {
  background: var(--bordure);
  color: var(--texte-attenue);
  cursor: not-allowed;
}

button#bouton-generer:not(:disabled):hover {
  background: var(--accent-fonce);
}

.erreur {
  background: var(--danger-fond);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.progression {
  margin-top: 1.5rem;
}

.barre-progression {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bordure);
  overflow: hidden;
}

.barre-progression-remplissage {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.texte-progression {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--texte-attenue);
  text-align: center;
}

.resultat {
  margin-top: 2rem;
  text-align: center;
}

.resultat video {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 12px;
  background: black;
  aspect-ratio: 9 / 16;
}

.bouton-lien {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  line-height: 1.6rem;
}

.bouton-lien:hover { background: var(--accent-fonce); }

@media (max-width: 400px) {
  .zone-depot { padding: 1.75rem 1rem; }
}
