/*
 * Styles de base des composants du kit (minuteur, formulaire, barre collante, liens de téléchargement).
 * Chaque page garde son propre style : elle règle ces variables et peut tout surcharger.
 */
:root {
  --tp-accent: #1d1b17;
  --tp-accent-texte: #fff;
  --tp-texte: #1d1b17;
  --tp-doux: #6b665c;
  --tp-fond: #fff;
  --tp-bord: #d9d2c3;
  --tp-erreur: #b3261e;
  --tp-rayon: 12px;
}

[hidden] { display: none !important; }

/* Minuteur : 3 blocs h / min / s */
[data-minuteur] { display: inline-flex; gap: 6px; font-variant-numeric: tabular-nums; }
[data-minuteur="texte"] { display: inline; }
body:not(.tp-pret) [data-minuteur]:empty::before { content: "--:--:--"; opacity: .5; }
.tp-m { display: inline-flex; align-items: baseline; gap: 2px; }
.tp-m b { font-size: 1.15em; }
.tp-m small { font-size: .7em; opacity: .75; }

/* Bonus rapides perdus quand l'offre est finie (vrai : le serveur ne les livre plus) */
.tp-bonus-perdu { opacity: .5; }
.tp-bonus-perdu h3, .tp-bonus-perdu .tp-bonus-titre { text-decoration: line-through; }

/* Formulaire */
form[data-commande] .tp-champ-erreur { border-color: var(--tp-erreur) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-erreur) 20%, transparent) !important; }
form[data-commande] [data-erreur] { color: var(--tp-erreur); font-weight: 600; font-size: 14px; margin: 6px 0 10px; }
form[data-commande] button[disabled] { opacity: .65; cursor: wait; }

/* Fenêtre de commande (dialog) */
dialog[data-dialogue-commande] {
  border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  background: var(--tp-fond); color: var(--tp-texte); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
dialog[data-dialogue-commande]::backdrop { background: rgba(10, 10, 10, .55); }
@media (max-width: 560px) {
  dialog[data-dialogue-commande] { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
}

/* Barre d'achat collante (téléphone) */
[data-barre] {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; transform: translateY(110%);
  transition: transform .25s ease; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
[data-barre].tp-visible { transform: none; }
@media (prefers-reduced-motion: reduce) { [data-barre] { transition: none; } }

/* Liens de téléchargement (page merci) */
.tp-lien {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; margin: 0 0 10px;
  border: 1.5px solid var(--tp-bord); border-radius: var(--tp-rayon); color: var(--tp-texte); text-decoration: none; background: var(--tp-fond);
}
.tp-lien:hover { border-color: var(--tp-accent); }
.tp-lien-nom { font-weight: 600; overflow-wrap: anywhere; }
.tp-lien-action {
  flex: none; background: var(--tp-accent); color: var(--tp-accent-texte); font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 999px;
}

/* Attente du paiement */
.tp-attente { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--tp-bord); border-top-color: var(--tp-accent); animation: tp-tourne 1s linear infinite; }
@keyframes tp-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tp-attente { animation-duration: 3s; } }
