/* ---------------------------------------------------------------------------
   Démo OIDC PingOne — feuille de style unique.
   Trois familles de couleurs seulement : l'encre du texte, le bleu de ce que
   fait l'application, le magenta de ce que fait PingOne.
   --------------------------------------------------------------------------- */

:root {
  --paper:  #edeff2;
  --panel:  #ffffff;
  --ink:    #101b2b;
  --muted:  #5e6c7f;
  --rule:   #cfd6de;
  --app:    #2c4a8c;   /* ce que fait l'application locale */
  --accent: #c1175a;   /* ce que fait PingOne */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Bandeau ------------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead__home {
  font-family: var(--serif);
  font-size: 1.0625rem;
  color: var(--ink);
  text-decoration: none;
}

.masthead__detail {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}

/* --- Colonne de lecture -------------------------------------------------- */

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

.lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -.012em;
  margin: 0 0 1.5rem;
}

.lede--small { font-size: clamp(1.5rem, 3.6vw, 1.95rem); }

.prose {
  max-width: 58ch;
  margin: 0 0 1.5rem;
  color: #35455c;
}

.section {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  margin: 3rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 2rem 0 3rem;
}

.button {
  display: inline-block;
  padding: .8rem 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover { background: #a3134c; border-color: #a3134c; }

.button--quiet {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}

.button--quiet:hover { background: var(--panel); border-color: var(--muted); }

/* --- Tableaux clé / valeur ----------------------------------------------- */

.settings {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.settings > div {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: .25rem 1.5rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule);
}

.settings dt {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--muted);
}

.settings dd {
  margin: 0;
  font-family: var(--mono);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}

/* --- La trace, colonne vertébrale de la démo ----------------------------- */

.trace {
  position: relative;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

/* Le fil vertical qui relie les étapes entre elles. */
.trace::before {
  content: "";
  position: absolute;
  left: 8.25rem;
  top: .4rem;
  bottom: .4rem;
  width: 1px;
  background: #bcc5d1;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 1.5rem;
  padding-bottom: 1.6rem;
  --dot: var(--muted);
}

/* Le point d'étape, coloré selon qui agit. */
.step::before {
  content: "";
  position: absolute;
  left: 8.25rem;
  top: .5rem;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--dot);
}

.step--app     { --dot: var(--app); }
.step--ping    { --dot: var(--accent); }
.step--browser { --dot: var(--muted); }

.step__who {
  grid-column: 1;
  text-align: right;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--dot);
  padding-top: .15rem;
}

.step__what {
  grid-column: 2;
  margin: 0;
}

.step__value {
  grid-column: 2;
  margin: .6rem 0 0;
  padding: .7rem .85rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--dot);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.55;
  color: #2b3a4f;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.step--failed .step__what { color: var(--accent); font-weight: 600; }
.step--failed { --dot: var(--accent); }

/* Chaque ligne arrive une par une : une apparition courte aide à suivre. */
.step {
  animation: appear .22s ease-out both;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.waiting {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--muted);
  margin: 0 0 0 9rem;
}

.waiting::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

/* --- Jetons repliés ------------------------------------------------------ */

.token {
  border-bottom: 1px solid var(--rule);
  padding: .7rem 0;
}

.token summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--app);
}

.token .step__value {
  --dot: var(--rule);
  margin-top: .7rem;
}

/* --- Petits écrans ------------------------------------------------------- */

@media (max-width: 40rem) {
  .trace::before { display: none; }
  .step::before { left: 0; top: .35rem; }
  .step {
    grid-template-columns: 1fr;
    padding-left: 1rem;
  }
  .step__who { grid-column: 1; text-align: left; padding: 0 0 .2rem; }
  .step__what, .step__value { grid-column: 1; }
  .waiting { margin-left: 1rem; }
  .settings > div { grid-template-columns: 1fr; }
}

/* --- Mouvement réduit ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .step { animation: none; }
  .waiting::after { animation: none; content: "…"; }
}
