/* =====================================================================
   MediPharmActu — Écrans d'authentification
   Direction : "carnet de garde" — sobre, clinique, précis.
   Teal profond (confiance, corps médical) + ambre pharmacie (accent,
   tamponné sur les sélections) sur un fond froid, pas le cliché
   crème + terracotta.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@500;600;700&family=Public+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --ink: #17262a;
  --ink-soft: #4c5f63;
  --paper: #eef3f2;
  --paper-raised: #ffffff;
  --primary: #0e4b54;
  --primary-dark: #093138;
  --accent: #d79a45;
  --accent-ink: #5c3d14;
  --error: #b5493a;
  --error-bg: #fbeeec;
  --line: #cdd9d6;
  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  background-image:
    linear-gradient(180deg, var(--paper) 0%, #e6edec 100%);
  font-family: var(--font-body);
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 64px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--paper-raised);
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 38, 42, 0.04), 0 8px 24px rgba(23, 38, 42, 0.06);
  overflow: hidden;
}

.card__masthead {
  background: var(--primary);
  color: #eef3f2;
  padding: 22px 24px 20px;
  position: relative;
}

.card__masthead::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 6px;
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent 6px, rgba(238,243,242,0.35) 6px, rgba(238,243,242,0.35) 8px
  );
  /* ligne perforée façon carnet à souche */
}

.card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 0 0 6px;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.01em;
}

.card__body { padding: 26px 24px 24px; }

/* Étapes — séquence réelle du formulaire, la numérotation a du sens ici */
.steps {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.steps__item { display: flex; align-items: center; gap: 6px; opacity: 0.45; transition: opacity .2s; }
.steps__item.is-active { opacity: 1; color: var(--primary); }
.steps__item.is-done { opacity: 0.7; }
.steps__num {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  border: none;
  border-bottom: 1.5px dashed var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  padding: 6px 2px 8px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus {
  border-bottom-style: solid;
  border-bottom-color: var(--primary);
}
.field small.hint { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 12px; }

/* Sélecteur de profession — deux badges qui se chevauchent, comme des
   cartes professionnelles posées sur le comptoir. Signature visuelle. */
.profession {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}
.badge-toggle {
  flex: 1;
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-soft);
}
.badge-toggle::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 22px; height: 8px;
  margin-left: -11px;
  background: var(--line);
  border-radius: 2px;
}
.badge-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.badge-toggle.is-selected {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px) rotate(-0.6deg);
  box-shadow: 0 6px 14px rgba(14,75,84,0.14);
}
.badge-toggle.is-selected::before { background: var(--primary); }

/* Grille de spécialités — chips tamponnées */
.specialites {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 6px;
}
.chip {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: transform .1s, background .12s, border-color .12s, color .12s;
}
.chip input { display: none; }
.chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: rotate(-1.1deg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(92,61,20,0.15);
}
.chip.is-selected::after { content: ' ✓'; }

.counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  margin: 2px 0 20px;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 3px;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, transform .06s;
}
.btn--primary { background: var(--primary); color: #eef3f2; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--primary:active { transform: scale(0.99); }
.btn--ghost {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--line);
  margin-top: 10px;
}
.btn-row { display: flex; gap: 10px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 3px;
  margin-bottom: 16px;
  display: none;
}
.msg.is-error { display: block; background: var(--error-bg); color: var(--error); }
.msg.is-ok { display: block; background: #e8f2ee; color: var(--primary-dark); }

.foot-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-soft);
}
.foot-link a { color: var(--primary); font-weight: 600; text-decoration: none; }
.foot-link a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .badge-toggle, .chip, .btn { transition: none; }
}
.case-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
