/* Carte de demande : un seul formulaire, deux textes (refaire ou retrouver), états d'envoi et succès. */

.demande {
  position: relative;
  max-width: 34rem;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--r3);
  box-shadow: var(--shadow-3);
  scroll-margin-block: 1.5rem;
  view-transition-name: demande;
}
.demande[data-mode="retrouve"] { box-shadow: 0 0 0 4px var(--cyan), var(--shadow-3); }

.demande-intro { margin-bottom: 1rem; font-weight: 700; }
.demande[data-mode="retrouve"] .demande-intro {
  padding: 0.5rem 0.75rem;
  background: #d9f3fd;
  border-left: 6px solid var(--cyan);
  border-radius: var(--r1);
}

.field { display: grid; gap: 0.3rem; margin-bottom: 1rem; }
.field > label { font-weight: 700; }
.hint { font-size: 0.95rem; }

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--paper);
  border: var(--line-thin) solid var(--ink);
  border-radius: var(--r1);
}
.field input[type="text"]:focus,
.field input[type="email"]:focus { background: #fffbd1; }
.field input:focus-visible { outline-offset: 2px; }

.field input[aria-invalid="true"] {
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgb(236 0 140 / 0.3);
}

.field-error {
  display: flex;
  gap: 0.5rem;
  align-items: start;
  padding: 0.4rem 0.6rem;
  font-weight: 700;
  background: #ffd6ec;
  border-left: 6px solid var(--magenta);
  border-radius: var(--r1);
}
.field-error::before {
  content: "!" / "";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  font: 400 1.1rem / 1 var(--display);
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
}

/* Case de consentement : grande, carrée, cochée en noir sur jaune. */
.field-check {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
}
.field-check > label { font-weight: 500; cursor: pointer; }
.field-check .hint,
.field-check .field-error { grid-column: 2; }

.field-check input {
  appearance: none;
  display: grid;
  place-content: center;
  width: 1.9rem;
  height: 1.9rem;
  margin: 0;
  background: var(--paper);
  border: var(--line-thin) solid var(--ink);
  border-radius: 0.45rem;
  cursor: pointer;
}
.field-check input::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  background: var(--ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
  scale: 0;
}
.field-check input:checked { background: var(--yellow); }
.field-check input:checked::before { scale: 1; }
.field-check input[aria-invalid="true"] { border-color: var(--magenta); box-shadow: 0 0 0 3px rgb(236 0 140 / 0.3); }

@media (forced-colors: active) {
  .field-check input { appearance: auto; width: 1.4rem; height: 1.4rem; }
  .field-check input::before { content: none; }
}

.turnstile { margin-bottom: 1rem; }

.demande .btn-go { width: 100%; margin-top: 0.25rem; font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }

.form-status { margin-top: 1rem; font-weight: 700; }
.form-status:empty { margin: 0; }
.form-status[data-tone="error"]:not(:empty) {
  padding: 0.6rem 0.8rem;
  background: #ffd6ec;
  border: var(--line-thin) solid var(--ink);
  border-radius: var(--r1);
}
.form-status[data-tone="info"]:not(:empty) {
  padding: 0.6rem 0.8rem;
  background: #d9f3fd;
  border: var(--line-thin) solid var(--ink);
  border-radius: var(--r1);
}

.switch { margin-top: 1rem; font-weight: 700; }

/* Succès : l'étoile KAPOW déborde de la case, comme en BD. */
.demande-ok {
  position: relative;
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding-top: 3.5rem;
}
.kapow {
  position: absolute;
  top: -5.5rem;
  right: -2.5rem;
  width: clamp(10rem, 18vw, 13rem);
  aspect-ratio: 1;
  pointer-events: none;
  --burst-size: clamp(2.2rem, 3vw, 2.9rem);
}
.ok-title {
  --reg: 4px;
  font: 400 clamp(3rem, 2rem + 4vw, 4.6rem) / 0.95 var(--display);
  letter-spacing: 0.03em;
}
.ok-title:focus { outline: none; }
.ok-text { max-width: 30rem; font-size: 1.15rem; font-weight: 500; }

@media (max-width: 30rem) {
  .kapow { right: -1rem; top: -4.5rem; }
  .demande-ok .btn-alt { font-size: 1.35rem; }
}
