/* ==========================================================================
   Signalement — formulaire public (familles) et suivi dans l'administration.
   Chargé uniquement sur la page Signalement et dans la section admin dédiée.
   ========================================================================== */

:root {
  --report-radius: 24px;
  --report-radius-field: 12px;
  --report-field-border: #d3dfe2;
  --report-field-border-hover: #b3c8cc;
  --report-focus-ring: 0 0 0 4px rgba(0, 124, 137, .16);
  --report-danger: #b9382f;
  --report-danger-soft: #fff0ec;
  --report-danger-line: #f3c3b8;
  --report-success: #176147;
  --report-success-soft: #e2f5ed;
  --report-text: #344154;
  --duration-fast: 160ms;
}

/* --- Mise en page --------------------------------------------------------- */

.report-section {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  background:
    radial-gradient(70% 45% at 0% 0%, rgba(0, 124, 137, .09), transparent 70%),
    radial-gradient(55% 40% at 100% 100%, rgba(242, 109, 91, .08), transparent 70%),
    linear-gradient(180deg, var(--paper), #edf5f3);
}

.report-main {
  min-width: 0;
}

/* Garde les champs et la confirmation visibles sous l'en-tête fixe lorsqu'ils reçoivent le focus. */
.report-form :is(input, textarea),
.report-success {
  scroll-margin-top: 140px;
}

/* --- Colonne d'accompagnement --------------------------------------------- */

.report-aside {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 22px;
}

.report-aside .eyebrow {
  margin-bottom: -10px;
  color: var(--teal);
}

.report-aside h2 {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 50px);
  line-height: 1;
  text-wrap: balance;
}

.report-aside-text {
  font-size: 17px;
  line-height: 1.65;
}

.report-aside-text p {
  margin: 0 0 10px;
}

.report-aside-text > :last-child {
  margin-bottom: 0;
}

.report-promises {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-promises li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  color: var(--report-text);
  font-size: 15px;
  line-height: 1.5;
}

.report-promises strong {
  display: block;
  color: var(--ink);
}

.report-promise-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--teal);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(20, 34, 53, .06);
}

.report-promises li:nth-child(2) .report-promise-icon {
  color: var(--coral);
}

.report-promise-icon svg {
  width: 20px;
  height: 20px;
}

.report-urgent {
  padding: 18px 20px;
  color: #6f2a20;
  background: var(--report-danger-soft);
  border: 1px solid var(--report-danger-line);
  border-radius: 18px;
}

.report-urgent strong {
  display: block;
  color: var(--report-danger);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.report-urgent p {
  margin: 4px 0 12px;
  font-size: 14px;
  line-height: 1.45;
}

.report-urgent-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-urgent-numbers a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  color: #6f2a20;
  background: var(--white);
  border: 1px solid var(--report-danger-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}

.report-urgent-numbers a:hover {
  background: #fff8f6;
  border-color: var(--report-danger);
}

.report-urgent-numbers a:focus-visible {
  outline: 3px solid var(--report-danger);
  outline-offset: 2px;
}

.report-urgent-numbers b {
  color: var(--report-danger);
  font-size: 18px;
  line-height: 1;
}

/* --- Carte formulaire ----------------------------------------------------- */

.report-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3.6vw, 48px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--report-radius);
  box-shadow: var(--shadow);
}

.report-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--teal) 0 25%, var(--coral) 25% 50%, var(--yellow) 50% 75%, var(--green) 75% 100%);
}

.report-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.report-required-note {
  margin: 0 0 clamp(22px, 2.6vw, 30px);
  color: var(--muted);
  font-size: 14px;
}

/* Mention de confidentialité mise en avant en tête du formulaire. */
.report-privacy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 4px 0 20px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(0, 124, 137, .12), rgba(0, 124, 137, .04));
  border: 1.5px solid rgba(0, 124, 137, .28);
  border-radius: 18px;
}

.report-privacy p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 2.1vw, 23px);
  font-weight: 600;
  line-height: 1.35;
}

.report-privacy strong {
  color: #00636e;
  font-weight: 900;
}

.report-privacy-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--white);
  background: var(--teal);
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(0, 124, 137, .22);
}

.report-privacy-icon svg {
  width: 18px;
  height: 18px;
}

.report-required {
  color: var(--coral);
  font-weight: 900;
}

.report-alert {
  margin: 0 0 18px;
  padding: 14px 18px;
  color: #8d1d13;
  background: var(--report-danger-soft);
  border: 1px solid var(--report-danger-line);
  border-left: 5px solid var(--report-danger);
  border-radius: 14px;
  font-weight: 700;
}

/* --- Étapes --------------------------------------------------------------- */

.report-step {
  --step-soft: rgba(0, 124, 137, .12);
  --step-ink: #00636e;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.report-step:nth-of-type(2) { --step-soft: rgba(242, 109, 91, .15); --step-ink: #b9382f; }
.report-step:nth-of-type(3) { --step-soft: rgba(244, 185, 66, .24); --step-ink: #8a6410; }
.report-step:nth-of-type(4) { --step-soft: rgba(90, 164, 105, .16); --step-ink: #35704a; }

.report-step + .report-step {
  margin-top: clamp(28px, 3vw, 40px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px dashed var(--line);
}

.report-step-title {
  float: left;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  margin: 0 0 20px;
  padding: 0;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 900;
  line-height: 1.2;
}

.report-step-title + * {
  clear: both;
}

.report-step-index {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: var(--step-ink);
  background: var(--step-soft);
  border-radius: 13px;
  font-size: 17px;
  font-weight: 900;
  transform: rotate(-5deg);
}

.report-optional {
  padding: 3px 11px;
  color: var(--muted);
  background: #eef2f4;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* --- Champs --------------------------------------------------------------- */

.report-field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.report-form .report-field > label {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.report-hint {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.report-field > .report-hint {
  margin: -2px 0 2px;
}

.report-form input:is([type="text"], [type="email"], [type="tel"]),
.report-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  color: var(--ink);
  background: #fbfdfd;
  border: 1.5px solid var(--report-field-border);
  border-radius: var(--report-radius-field);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition:
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    background-color var(--duration-fast) ease;
}

.report-form textarea {
  min-height: 190px;
  line-height: 1.6;
  resize: vertical;
}

.report-form input:is([type="text"], [type="email"], [type="tel"]):hover,
.report-form textarea:hover {
  border-color: var(--report-field-border-hover);
}

.report-form input:is([type="text"], [type="email"], [type="tel"]):focus,
.report-form textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--teal);
  box-shadow: var(--report-focus-ring);
}

.report-form [aria-invalid="true"]:is(input, textarea) {
  background: #fffafa;
  border-color: var(--report-danger);
}

.report-form [aria-invalid="true"]:is(input, textarea):focus {
  box-shadow: 0 0 0 4px rgba(185, 56, 47, .15);
}

.report-error {
  margin: 0;
  color: var(--report-danger);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.report-field-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-counter {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-counter.is-near {
  color: var(--report-danger);
  font-weight: 800;
}

/* --- Trombinoscope sélectionnable ----------------------------------------- */

.report-people-group + .report-people-group {
  margin-top: 22px;
}

.report-people-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.report-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-people > li {
  min-width: 0;
}

.report-form .report-person {
  --accent: var(--teal);
  --accent-soft: rgba(0, 124, 137, .12);
  --accent-ink: #00636e;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  height: 100%;
  margin: 0;
  padding: 20px 10px 16px;
  color: var(--ink);
  text-align: center;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-normal) ease,
    background-color var(--duration-fast) ease;
}

.report-people > li:nth-child(4n + 2) .report-person { --accent: var(--coral); --accent-soft: rgba(242, 109, 91, .14); --accent-ink: #b9382f; }
.report-people > li:nth-child(4n + 3) .report-person { --accent: var(--yellow); --accent-soft: rgba(244, 185, 66, .22); --accent-ink: #8a6410; }
.report-people > li:nth-child(4n + 4) .report-person { --accent: var(--green); --accent-soft: rgba(90, 164, 105, .15); --accent-ink: #35704a; }

.report-person:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(20, 34, 53, .1);
}

.report-person:active {
  transform: scale(.98);
}

.report-person-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.report-person:has(.report-person-input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.report-person:has(.report-person-input:checked) {
  background: linear-gradient(180deg, var(--accent-soft), var(--white) 72%);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 14px 30px rgba(20, 34, 53, .08);
}

.report-person-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--white);
  background: var(--white);
  border: 1.5px solid #cfdadd;
  border-radius: 999px;
  transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.report-person-check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(.4);
  transition: opacity var(--duration-fast) ease, transform var(--duration-normal) var(--ease-out-expo);
}

.report-person:has(.report-person-input:checked) .report-person-check {
  background: var(--accent);
  border-color: var(--accent);
}

.report-person:has(.report-person-input:checked) .report-person-check svg {
  opacity: 1;
  transform: scale(1);
}

.report-person-photo {
  display: grid;
  place-items: center;
  width: 84px;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--accent-soft);
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--accent-soft);
}

.report-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-person-initials {
  color: var(--accent-ink);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .03em;
  line-height: 1;
}

.report-person-name {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.report-person-role {
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.report-selection {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.report-selection.has-selection {
  color: var(--teal);
}

/* --- Consentement et envoi ------------------------------------------------ */

.report-consent-wrap {
  display: grid;
  gap: 8px;
  margin-top: clamp(26px, 3vw, 36px);
}

.report-form .report-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  color: var(--report-text);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.report-form .report-consent:hover {
  border-color: var(--report-field-border-hover);
}

.report-consent-wrap.has-error .report-consent {
  border-color: var(--report-danger);
}

.report-form .report-consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 24px;
}

.report-legal {
  flex: 1 1 240px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.report-form .report-submit {
  gap: 10px;
  min-height: 58px;
  padding: 0 28px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: 0 14px 28px rgba(0, 124, 137, .26);
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) ease,
    background-color var(--duration-fast) ease;
}

.report-submit svg {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.report-form .report-submit:hover {
  background: #006a75;
  box-shadow: 0 18px 34px rgba(0, 124, 137, .32);
}

.report-submit:hover svg {
  transform: translateX(4px);
}

.report-form .report-submit:active {
  transform: translateY(1px);
  box-shadow: 0 8px 18px rgba(0, 124, 137, .24);
}

.report-form .report-submit:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.report-form .report-submit:disabled {
  cursor: progress;
  opacity: .72;
}

/* --- Confirmation --------------------------------------------------------- */

.report-success {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.report-success:focus {
  outline: none;
}

.report-success-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 6px;
  color: var(--report-success);
  background: var(--report-success-soft);
  border-radius: 22px;
}

.report-success-icon svg {
  width: 34px;
  height: 34px;
}

.report-success .eyebrow {
  margin: 0;
  color: var(--teal);
}

.report-success h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.05;
}

.report-success > p {
  max-width: 560px;
  margin: 0;
  color: var(--report-text);
  font-size: 17px;
}

.report-success-ref strong {
  padding: 3px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}

.report-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.report-button-ghost {
  color: var(--teal);
  background: var(--white);
  border: 1.5px solid #bfdcd8;
}

.report-button-ghost:hover {
  border-color: var(--teal);
}

@media (prefers-reduced-motion: no-preference) {
  .report-person:hover {
    transform: translateY(-3px);
  }

  .report-form .report-submit:hover {
    transform: translateY(-2px);
  }

  .report-success-icon {
    animation: report-pop 560ms var(--ease-out-expo) both;
  }

  @keyframes report-pop {
    from { opacity: 0; transform: scale(.55) rotate(-14deg); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .report-person,
  .report-person-check svg,
  .report-submit,
  .report-submit svg {
    transition: none;
  }
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1080px) {
  .report-section {
    grid-template-columns: 1fr;
  }

  .report-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .report-person-photo {
    width: 72px;
  }

  .report-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .report-legal {
    flex: none;
  }

  .report-form .report-submit {
    width: 100%;
  }
}
