/* =========================================================================
   TELC B1 — Salle d'examen
   Identité visuelle reprise de la maquette TOLC-I : feuille d'examen
   officielle (papier clair, grille légère), tampon d'en-tête, encre
   bleu/rouge pour la correction, typographie serif + mono.

   Feuille de style écrite MOBILE FIRST : les règles de base sont pensées
   pour un téléphone ; les media queries (min-width) ajoutent des
   finitions pour les écrans plus larges, elles ne retirent rien.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --paper: #eeefe6;
  --paper-deep: #e6e7db;
  --grid-line: rgba(31, 78, 140, 0.08);
  --ink: #211f1a;
  --ink-soft: #55534a;
  --ink-faint: #8b8878;
  --rule: #cfcdbd;

  --blu: #1f4e8c;
  --blu-deep: #163a68;
  --blu-wash: rgba(31, 78, 140, 0.09);
  --rosso: #b2392a;
  --rosso-deep: #8c2c20;
  --rosso-wash: rgba(178, 57, 42, 0.09);
  --oro: #9c7a2e;
  --oro-deep: #7a5f22;
  --oro-wash: rgba(156, 122, 46, 0.12);
  --verde: #3f7d54;
  --verde-wash: rgba(63, 125, 84, 0.1);

  --card: #f8f7f0;
  --card-border: #d9d7c7;
  --shadow-flat: 0 1px 0 rgba(33, 31, 26, 0.06);
  --shadow-card: 0 2px 4px rgba(33, 31, 26, 0.06), 0 10px 24px -14px rgba(33, 31, 26, 0.25);
  --shadow-modal: 0 12px 32px -8px rgba(33, 31, 26, 0.35);

  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 3px;
  --tap: 48px; /* hauteur minimale tactile confortable (44-48px) */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* fine grille de papier quadrillé, en fond */
.sheet-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 40%, transparent 85%);
}

a { color: var(--blu-deep); }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---- conteneur : mobile first, s'élargit avec l'écran ---- */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 14px 96px;
}

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

@media (min-width: 560px) {
  .sheet-grid { background-size: 28px 28px; }
  .wrap { padding: 28px 20px 72px; }
}

@media (min-width: 900px) {
  .wrap-wide { max-width: 1180px; }
}

/* ---------------------------------------------------------------------- */
/* Masthead / en-tête type formulaire officiel                            */
/* ---------------------------------------------------------------------- */

.masthead { margin-bottom: 18px; }
.masthead-compact { margin-bottom: 16px; }

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.stamp-mini {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--blu);
  color: var(--blu-deep);
  padding: 3px 8px;
  border-radius: 2px;
  transform: rotate(-2deg);
  font-weight: 600;
  white-space: nowrap;
}
.stamp-mini.stamp-live { border-color: var(--verde); color: var(--verde); }

.masthead-code { text-transform: uppercase; }

.title-serif {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.08;
  margin: 0 0 10px;
  color: var(--ink);
}

.title-sub {
  display: block;
  font-size: 15px;
  font-weight: 500;
  font-style: italic;
  color: var(--blu-deep);
  margin-top: 3px;
}

.masthead-desc {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 14px;
}

@media (min-width: 560px) {
  .masthead { margin-bottom: 22px; }
  .masthead-compact { margin-bottom: 18px; }
  .masthead-top { margin-bottom: 14px; font-size: 11px; }
  .title-serif { font-size: 38px; margin-bottom: 12px; }
  .title-sub { font-size: 18px; margin-top: 4px; }
  .masthead-desc { font-size: 15px; }
}

/* ---------------------------------------------------------------------- */
/* Cartes génériques                                                       */
/* ---------------------------------------------------------------------- */

.panel, .exam-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.panel + .panel { margin-top: 14px; }

.exam-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.exam-card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (min-width: 560px) {
  .panel, .exam-card { padding: 22px; }
}

.paper {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  line-height: 1.7;
  font-size: 15px;
  border: 1px solid var(--rule);
}
.paper h3 { color: var(--ink); font-family: var(--font-display); }

@media (min-width: 560px) { .paper { padding: 20px; } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); }
h2 { font-size: 21px; margin-bottom: 6px; }
h3 { font-size: 17px; }

.sub { color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

/* ---------------------------------------------------------------------- */
/* Liste des candidats (index.html)                                       */
/* ---------------------------------------------------------------------- */

.candidate-list {
  display: flex;
  flex-direction: column;
}

.candidate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 6px;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.candidate-list .candidate-row:last-child { border-bottom: none; }
.candidate-row:hover, .candidate-row:focus-visible {
  background: var(--blu-wash);
  outline: none;
}

.candidate-row .num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.candidate-row:hover .num, .candidate-row:focus-visible .num {
  border-color: var(--blu);
  color: var(--blu-deep);
}

.candidate-row .info { flex: 1 1 auto; min-width: 0; }
.candidate-row .name {
  font-family: var(--font-display);
  font-size: 16.5px;
  color: var(--ink);
}
.candidate-row .variant-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.candidate-row .chevron {
  flex-shrink: 0;
  color: var(--ink-faint);
  font-size: 16px;
}
.candidate-row:hover .chevron, .candidate-row:focus-visible .chevron { color: var(--blu); }

/* ---------------------------------------------------------------------- */
/* Boutons                                                                 */
/* ---------------------------------------------------------------------- */

button, .btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  padding: 12px 16px;
  min-height: var(--tap);
  cursor: pointer;
  background: var(--blu);
  color: #f5f4ec;
  box-shadow: var(--shadow-flat);
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:hover:not(:disabled) { background: var(--blu-deep); }
button:focus-visible { outline: 2px solid var(--blu); outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--rule);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-faint); background: transparent; }

.btn-listen {
  background: var(--card);
  border: 1.5px solid var(--blu);
  color: var(--blu-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  min-height: 40px;
  box-shadow: none;
}
.btn-listen:hover:not(:disabled) { background: var(--blu-wash); }

/* ---------------------------------------------------------------------- */
/* Barre de progression + navigation des sections (exam.html)             */
/* ---------------------------------------------------------------------- */

.exam-topbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.exam-name { font-size: 22px; }

.timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.timer-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.timer {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--blu-deep);
  letter-spacing: 0.03em;
}
.timer.warning { color: var(--oro-deep); }
.timer.danger { color: var(--rosso-deep); animation: timer-pulse 1s ease-in-out infinite; }

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.section-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 0 4px;
  margin-bottom: 4px;
}
.section-nav::-webkit-scrollbar { display: none; }

.section-pill {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  color: var(--ink-faint);
  white-space: nowrap;
}
.section-pill.active { border-color: var(--blu); color: var(--blu-deep); background: var(--blu-wash); }
.section-pill.done { border-color: var(--verde); color: var(--verde); }

.progress-track {
  height: 5px;
  background: var(--card-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blu);
  transition: width 0.35s ease;
}

/* ---------------------------------------------------------------------- */
/* Contenu de l'épreuve : questions, options, écriture                    */
/* ---------------------------------------------------------------------- */

.q-block {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 16px;
}
.q-block:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.q-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--blu-deep);
  margin-right: 6px;
}

.options { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option-label:hover { border-color: var(--blu); background: var(--blu-wash); }
.option-label input { accent-color: var(--blu); width: 19px; height: 19px; margin-top: 2px; flex-shrink: 0; }

.tf-toggle { display: flex; gap: 8px; margin-top: 10px; }
.tf-btn {
  flex: 1;
  min-height: var(--tap);
  padding: 10px;
  text-align: center;
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}
.tf-btn.selected-true { background: var(--verde); color: #fff; border-color: var(--verde); }
.tf-btn.selected-false { background: var(--rosso); color: #fff; border-color: var(--rosso); }

textarea.answer-box, textarea.essay-box {
  width: 100%;
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  resize: vertical;
  margin-top: 10px;
  background: var(--card);
  color: var(--ink);
}
.essay-box { min-height: 280px; line-height: 1.6; }

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
  padding: 14px;
  background: var(--oro-wash);
  border-radius: var(--radius);
}
.word-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--card);
  border: 1px solid var(--ink-faint);
  border-radius: var(--radius);
  padding: 3px 8px;
}

.audio-block {
  background: var(--blu-wash);
  border: 1.5px dashed var(--blu);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.audio-block .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* pulsanti azione empilés sur mobile, alignés en ligne dès 480px */
.q-block[style*="justify-content: space-between"] {}

footer.note {
  margin-top: 32px;
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.6;
}

input[type=text] {
  font-family: var(--font-body);
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
}

/* ---------------------------------------------------------------------- */
/* Écran de verrouillage — temps écoulé                                   */
/* ---------------------------------------------------------------------- */

.exam-locked-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(33, 31, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.locked-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 28px 22px;
  max-width: 380px;
  text-align: center;
}
.locked-card .stamp { margin-bottom: 14px; }
.locked-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Tampon de correction (réutilisé pour les écrans de fin d'épreuve)      */
/* ---------------------------------------------------------------------- */

.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 2.5px solid currentColor;
  border-radius: var(--radius);
  transform: rotate(-3deg);
  color: var(--verde);
}
.stamp.is-incorrect { color: var(--rosso); }
.stamp.is-neutral { color: var(--ink-faint); }

/* ---------------------------------------------------------------------- */
/* Tableau de bord (dashboard.html)                                       */
/* ---------------------------------------------------------------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 18px 0 20px;
}
@media (min-width: 480px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }

.stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
}
.stat .num { font-family: var(--font-mono); font-size: 24px; color: var(--blu-deep); font-weight: 600; }
.stat .lbl { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 13.5px;
  white-space: nowrap;
}
th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
}
.status-dot.online { background: var(--verde); box-shadow: 0 0 6px var(--verde); }
.status-dot.offline { background: #a9a596; }
.status-dot.done { background: var(--blu); box-shadow: 0 0 6px var(--blu); }

.score-cell { font-family: var(--font-mono); }
.total-cell { font-family: var(--font-mono); font-weight: 700; color: var(--blu-deep); }

.time-cell { font-family: var(--font-mono); font-weight: 600; color: var(--blu-deep); }
.time-cell.warning { color: var(--oro-deep); }
.time-cell.danger { color: var(--rosso-deep); }
.time-cell.expired { color: var(--rosso-deep); font-weight: 700; }

.schreiben-input {
  width: 64px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1.5px solid var(--blu);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------------- */
/* Espace correcteur (admin.html)                                         */
/* ---------------------------------------------------------------------- */

.global-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
}
.global-actions button { width: auto; }

.correction-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 14px;
}
@media (min-width: 560px) { .correction-card { padding: 20px; } }

.correction-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.correction-head .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-right: 8px;
}
.correction-head .name { font-family: var(--font-display); font-size: 17px; }
.correction-head .variant-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin-left: 8px;
}
.correction-total {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--blu-deep);
  white-space: nowrap;
}

.correction-scores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 480px) { .correction-scores { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .correction-scores { grid-template-columns: repeat(8, 1fr); } }

.score-field { display: flex; flex-direction: column; gap: 4px; }
.score-field label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.score-field input {
  font-family: var(--font-mono);
  padding: 8px 9px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  width: 100%;
}
.score-field input:focus { border-color: var(--blu); outline: none; }

.correction-schreiben {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.correction-schreiben h3 { margin-bottom: 10px; }

.essay-view {
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  font-size: 14px;
}
.essay-view.is-empty { color: var(--ink-faint); font-style: italic; }

.schreiben-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.schreiben-field label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.schreiben-field input {
  width: 84px;
  font-family: var(--font-mono);
  padding: 8px 9px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1.5px solid var(--blu);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
}

.correction-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.correction-actions button { width: auto; }

@media (prefers-reduced-motion: reduce) {
  .timer.danger { animation: none; }
}

/* ---------------------------------------------------------------------- */
/* Portail École — connexion (school-login.html)                          */
/* Même identité "feuille officielle" que le reste de l'app : le cachet   */
/* d'accréditation en angle rappelle qu'une école doit être agréée pour   */
/* faire passer les épreuves, sans surcharger un écran voulu épuré.       */
/* ---------------------------------------------------------------------- */

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 30px 24px 24px;
}

.auth-stamp {
  position: absolute;
  top: -15px;
  right: 20px;
  font-size: 9.5px;
  padding: 5px 9px;
}

.auth-head { margin-bottom: 22px; }
.auth-head .stamp-mini { margin-bottom: 14px; }
.auth-head h1 {
  font-size: 24px;
  margin-bottom: 8px;
}
.auth-head .sub { margin: 0; }

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  padding: 12px 13px;
  min-height: var(--tap);
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}
.auth-field input:focus { border-color: var(--blu); outline: none; }

.auth-password-row { position: relative; }
.auth-password-row input { padding-right: 78px; }

/* Certains navigateurs (Edge, Chrome) ajoutent leur propre icône "œil"
   dans les champs password — redondante avec le bouton texte
   Afficher/Masquer déjà présent. On la masque pour ne garder que le
   texte. */
.auth-password-row input[type="password"]::-ms-reveal,
.auth-password-row input[type="password"]::-ms-clear {
  display: none;
}
.auth-password-row input::-webkit-credentials-auto-fill-button,
.auth-password-row input::-webkit-strong-password-auto-fill-button {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}
.auth-toggle-pw {
  position: absolute;
  right: 5px;
  top: 5px;
  width: auto;
  min-height: 38px;
  padding: 6px 10px;
  background: transparent;
  color: var(--ink-faint);
  box-shadow: none;
  border-color: transparent;
  font-size: 11px;
  font-family: var(--font-mono);
}
.auth-toggle-pw:hover:not(:disabled) {
  background: var(--blu-wash);
  color: var(--blu-deep);
  border-color: transparent;
}

.auth-error, .auth-success {
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.auth-error {
  background: var(--rosso-wash);
  border: 1px solid var(--rosso);
  color: var(--rosso-deep);
}
.auth-success {
  background: var(--verde-wash);
  border: 1px solid var(--verde);
  color: #2c5c3c;
}

.auth-submit { width: 100%; margin-top: 4px; }

.auth-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-link {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--blu-deep);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 0;
  min-height: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link:hover:not(:disabled) { background: none; color: var(--blu); }

.auth-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.auth-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(245, 244, 236, 0.4);
  border-top-color: #f5f4ec;
  animation: auth-spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation: none; }
}