:root {
  --bleu: #0e2f5c;
  --bleu-clair: #1f5fa8;
  --or: #c99a3e;
  --fond: #f4f6fa;
  --carte: #ffffff;
  --texte: #1c2433;
  --gris: #6b7588;
  --bord: #d9dee8;
  --rouge: #c0392b;
  --orange: #e67e22;
  --vert: #2e8b57;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  color: var(--texte);
  background: var(--fond);
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

h1 { font-size: 1.4rem; color: var(--bleu); }
h2 { font-size: 1.1rem; color: var(--bleu); margin-top: 28px; }

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bleu);
  color: #fff;
}
.entete form { margin: 0; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }

.bouton {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--bord);
  border-radius: 12px;
  background: var(--carte);
  color: var(--bleu);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.bouton.principal { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.bouton.grand { padding: 18px; font-size: 1.1rem; }
.bouton.entree { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 20px; font-size: 1.1rem; text-align: left; }
.picto { font-size: 1.8rem; }

.lien { background: none; border: none; color: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; padding: 0; }
.lien.danger { color: var(--rouge); }

label { display: block; margin-bottom: 14px; font-size: 0.85rem; color: var(--gris); font-weight: 600; }
input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--bord);
  border-radius: 10px;
  background: var(--carte);
  color: var(--texte);
  font-size: 1rem; /* 16px minimum : évite le zoom automatique de l'iPhone */
  font-family: inherit;
}
label.douteux { color: var(--orange); }
label.douteux input, label.douteux textarea { border: 2px solid var(--orange); background: #fff7ee; }

.connexion { max-width: 360px; margin: 10vh auto 0; text-align: center; }
.connexion form { text-align: left; }
.icone-connexion { width: 88px; height: 88px; border-radius: 20px; }

.erreur { padding: 12px; border-radius: 10px; background: #fdecea; color: var(--rouge); }
.alerte { padding: 10px 12px; border-radius: 10px; background: #fff7ee; color: var(--orange); font-weight: 600; }
.resume { padding: 12px; border-left: 4px solid var(--or); background: var(--carte); border-radius: 0 10px 10px 0; }
.vide { color: var(--gris); }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li { margin-bottom: 10px; }
.liste a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--carte);
  border: 1px solid var(--bord);
  color: var(--texte);
  text-decoration: none;
}
.liste .nom { font-weight: 600; }
.liste .detail { grid-column: 1 / -1; color: var(--gris); font-size: 0.9rem; }
.liste .date { grid-column: 1 / -1; color: var(--gris); font-size: 0.8rem; }

.statut { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; vertical-align: middle; }
.statut.a_verifier { background: #fff1e0; color: var(--orange); }
.statut.validee { background: #e6f4ec; color: var(--vert); }
.statut.envoyee { background: #e3edf9; color: var(--bleu-clair); }

.enregistrement { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 16px; border-radius: 12px; background: #fdecea; color: var(--rouge); font-weight: 600; }
.enregistrement .bouton { margin-top: 8px; }
.point { width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); animation: clignote 1s infinite; }
@keyframes clignote { 50% { opacity: 0.2; } }

.bloc-texte summary { list-style: none; }
.bloc-texte summary::-webkit-details-marker { display: none; }
.bloc-texte textarea { margin-bottom: 10px; }

.attente { text-align: center; padding: 40px 0; color: var(--gris); }
.roue { width: 48px; height: 48px; margin: 0 auto 16px; border: 5px solid var(--bord); border-top-color: var(--bleu); border-radius: 50%; animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.actions { display: grid; gap: 10px; margin-top: 20px; }
.source { margin-top: 24px; color: var(--gris); }
.source p { white-space: pre-wrap; }
.supprimer { margin-top: 24px; text-align: center; }

.jeton { margin: 16px 0; padding: 14px; border: 2px solid var(--or); border-radius: 12px; background: var(--carte); }
.jeton code, .etapes code { word-break: break-all; }
.jeton code { display: block; margin-bottom: 12px; padding: 10px; background: var(--fond); border-radius: 8px; font-size: 0.95rem; }
.etapes li { margin-bottom: 12px; line-height: 1.4; }
.etapes ul { margin-top: 6px; padding-left: 20px; }
.lien-bas { display: block; margin-top: 28px; text-align: center; color: var(--bleu-clair); }

[hidden] { display: none !important; }
