/* Page d'entrée du coffre. Mêmes jetons de couleur que src/styles/global.css. */

body.coffre {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: rgba(11, 11, 11, 0.1);
  --axis: #c3c2b7;
  --critical: #d03b3b;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
  body.coffre {
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --line: rgba(255, 255, 255, 0.1);
    --axis: #383835;
    --critical: #e66767;
  }
}
body.coffre main {
  width: min(22rem, calc(100vw - 2rem));
}
/* Prioritaire : une carte masquée le reste, quel que soit son affichage une fois montrée. */
body.coffre [hidden] {
  display: none !important;
}
body.coffre .carte {
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
body.coffre h1 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body.coffre .aide {
  margin: -0.5rem 0 0.75rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  text-wrap: pretty;
}
body.coffre label {
  color: var(--ink-2);
  font-size: 0.75rem;
}
body.coffre input,
body.coffre .bouton {
  box-sizing: border-box;
  min-height: 2.75rem;
  font: inherit;
  /* 16 px : en dessous, iOS zoome sur le champ. */
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.375rem;
  border: 1px solid var(--line);
}
body.coffre input {
  background: var(--page);
  color: var(--ink);
  outline: none;
}
body.coffre input:focus-visible {
  border-color: var(--axis);
}
body.coffre .bouton {
  display: grid;
  place-items: center;
  margin-top: 0.5rem;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
body.coffre h1 + .bouton,
body.coffre .aide + .bouton {
  margin-top: 0;
}
body.coffre .bouton.second {
  margin-top: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 400;
}
body.coffre .bouton:disabled {
  opacity: 0.6;
  cursor: progress;
}
body.coffre .bouton:focus-visible,
body.coffre .discret:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
body.coffre .alerte {
  margin: 0.25rem 0 0;
  color: var(--critical);
  font-size: 0.8125rem;
  text-wrap: pretty;
}
body.coffre .alerte:empty:not(.reservee) {
  display: none;
}
body.coffre .alerte.reservee {
  min-height: 1.25rem;
  margin: 0;
}
body.coffre .alerte.reservee + .bouton {
  margin-top: 0;
}
body.coffre ::selection {
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}
/* Action secondaire : un texte, avec une zone de toucher confortable. */
body.coffre .discret {
  justify-self: start;
  min-height: 2.75rem;
  margin: 0 0 -0.75rem -0.5rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
body.coffre .discret:disabled {
  cursor: default;
}
@media (hover: hover) {
  body.coffre .discret:enabled:hover {
    color: var(--ink);
  }
}
body.coffre .coffre-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}
.coffre-note {
  color: var(--muted);
  text-align: center;
}
