:root {
  --violet: #6B21A8;
  --violet-fonce: #341060;
  --orange: #F49A1C;
  --lavande: #F1F0FA;
  --blanc: #FFFFFF;
  --gris-texte: #3A3646;
  --rouge-erreur: #C4321F;
  --vert-ok: #1F7A45;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--lavande);
  color: var(--gris-texte);
  font-family: 'Figtree', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .titre {
  font-family: 'Poppins', 'Figtree', system-ui, sans-serif;
  color: var(--violet-fonce);
  margin: 0 0 0.5rem 0;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem 1rem;
  min-height: 100vh;
}

.entete {
  text-align: center;
  padding: 1rem 0 1.5rem 0;
}

.entete .logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--violet);
}

.entete .sous-titre {
  font-size: 0.9rem;
  color: var(--gris-texte);
  opacity: 0.8;
}

.carte {
  background: var(--blanc);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(52, 16, 96, 0.08);
}

.encadre-rappel {
  background: #FBF0DE;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.champ {
  margin-bottom: 1.1rem;
}

.champ label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--violet-fonce);
  font-size: 0.95rem;
}

.champ .facultatif {
  font-weight: 400;
  color: #8A84A0;
  font-size: 0.82rem;
}

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 2px solid #DDD8ED;
  border-radius: 10px;
  font-family: 'Figtree', sans-serif;
  font-size: 1rem;
  background: var(--blanc);
  color: var(--gris-texte);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--violet);
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
  line-height: 1.4;
}

.bouton {
  display: block;
  width: 100%;
  padding: 1.1rem 1rem;
  border: none;
  border-radius: 14px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  text-align: center;
  margin-bottom: 0.75rem;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

.bouton:active {
  transform: scale(0.98);
}

.bouton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bouton-principal {
  background: var(--violet);
  color: var(--blanc);
}

.bouton-principal:hover:not(:disabled) {
  background: var(--violet-fonce);
}

.bouton-accent {
  background: var(--orange);
  color: var(--violet-fonce);
}

.bouton-secondaire {
  background: var(--blanc);
  color: var(--violet);
  border: 2px solid var(--violet);
}

.bouton-discret {
  background: transparent;
  color: var(--violet);
  text-decoration: underline;
  padding: 0.6rem 1rem;
}

.guide-etapes {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.guide-etapes li {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #EDEAF7;
  font-size: 0.95rem;
  line-height: 1.4;
}

.guide-etapes li:last-child {
  border-bottom: none;
}

.guide-etapes .numero {
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--violet);
  color: var(--blanc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.zone-micro {
  text-align: center;
  padding: 1.5rem 0;
}

.bouton-micro {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: none;
  background: var(--violet);
  color: var(--blanc);
  font-size: 2.6rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(107, 33, 168, 0.35);
  transition: background 0.2s ease, transform 0.1s ease;
}

.bouton-micro:active {
  transform: scale(0.96);
}

.bouton-micro.enregistrement {
  background: var(--rouge-erreur);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 50, 31, 0.5); }
  70% { box-shadow: 0 0 0 22px rgba(196, 50, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 50, 31, 0); }
}

.minuteur {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  color: var(--violet-fonce);
  margin-top: 1rem;
  font-variant-numeric: tabular-nums;
}

.minuteur.presque-fini {
  color: var(--rouge-erreur);
}

.etat-micro {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: var(--gris-texte);
}

.message-erreur {
  background: #FBE7E4;
  color: var(--rouge-erreur);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.message-succes {
  background: #E6F4EB;
  color: var(--vert-ok);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.spinner-zone {
  text-align: center;
  padding: 2.5rem 0;
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem auto;
  border: 5px solid #E4DEF2;
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: tourner 0.9s linear infinite;
}

@keyframes tourner {
  to { transform: rotate(360deg); }
}

.groupe-radio {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border: 2px solid #DDD8ED;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

.option-radio.selectionne {
  border-color: var(--violet);
  background: #F6F1FC;
}

.option-radio input {
  margin-top: 0.15rem;
}

.confirmation {
  text-align: center;
  padding: 2rem 0;
}

.confirmation .numero-fiche {
  font-family: 'Poppins', sans-serif;
  font-size: 2.2rem;
  color: var(--violet);
  margin: 1rem 0;
}

.compteur-session {
  font-size: 0.9rem;
  color: var(--gris-texte);
  opacity: 0.75;
  margin-bottom: 1.5rem;
}

.ecran {
  display: none;
}

.ecran.actif {
  display: block;
}

.sous-champs {
  padding-left: 0.9rem;
  border-left: 3px solid #EDEAF7;
  margin-bottom: 1rem;
}

.etiquette-champ-fiche {
  font-weight: 700;
  color: var(--violet);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
  display: block;
}

/* Admin */
.admin-shell {
  max-width: 100%;
  padding: 1rem;
}

table.tableau-fiches {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--blanc);
}

table.tableau-fiches th,
table.tableau-fiches td {
  border: 1px solid #E4DEF2;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}

table.tableau-fiches th {
  background: var(--violet);
  color: var(--blanc);
  position: sticky;
  top: 0;
}

.conteneur-tableau {
  overflow-x: auto;
  margin-top: 1rem;
}

@media (min-width: 600px) {
  .zone-micro .bouton-micro {
    width: 160px;
    height: 160px;
  }
}
