/* ==========================================================================
   Site public — structure, en-tête, L'essentiel, formulaire, pied de page
   (la scène du récit est dans stage.css)
   ========================================================================== */

/* Parcours : variantes particulier / entreprise */
html[data-audience="particulier"] [data-aud="entreprise"],
html[data-audience="entreprise"] [data-aud="particulier"] {
  display: none !important;
}

.kicker {
  margin: 0 0 var(--s-3);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.placeholder {
  display: inline-block;
  padding: 1px 8px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-family: var(--f-mono);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.4);
}

/* Barre prototype */
.proto-bar {
  margin: 0;
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 6px var(--s-4);
  background: var(--ink);
  color: #e9e6df;
  font-size: 0.75rem;
  text-align: center;
}
.proto-bar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0a37f;
  flex: none;
}

/* En-tête */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: 64px;
  padding: 0 clamp(16px, 3vw, 40px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand__mark {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--thread);
  stroke-width: 3;
  stroke-linecap: round;
}
.brand__name {
  font-family: var(--f-display);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand__role {
  color: var(--ink-3);
  padding-left: var(--s-2);
  border-left: 1px solid var(--line-2);
}
.site-nav {
  display: flex;
  gap: var(--s-5);
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--t-sm);
}
.site-nav a:hover {
  color: var(--thread);
}

/* Sélecteur de parcours */
.audience {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--sheet);
}
.audience__btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--d-med);
}
.audience__btn[aria-pressed="true"] {
  color: #fff;
}
.audience__pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: var(--r-pill);
  background: var(--ink);
  transition: transform var(--d-med) var(--ease-out);
}
html[data-audience="entreprise"] .audience__pill {
  transform: translateX(100%);
}

/* Sections communes */
.sec-head {
  max-width: 1320px;
  margin: 0 auto var(--s-7);
}
.sec-title {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--t-3xl);
  line-height: 1;
  letter-spacing: -0.02em;
}
.lead {
  font-size: var(--t-lg);
  color: var(--ink-2);
  max-width: 40ch;
}

/* ============ L'ESSENTIEL ============ */
.essentiel {
  position: relative;
  z-index: 2;
  padding: var(--s-9) clamp(16px, 4vw, 56px) var(--s-9);
  background: var(--paper);
  outline: none;
  scroll-margin-top: 56px;
}
.bento {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-4);
}
.tile {
  position: relative;
  padding: clamp(20px, 2.4vw, 36px);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
}
.tile__title {
  margin: 0 0 var(--s-3);
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--t-2xl);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.tile--who {
  grid-column: span 7;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) 1.2fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: stretch;
}
.tile--for {
  grid-column: span 5;
}
.tile--how {
  grid-column: span 5;
}
.tile--space {
  grid-column: span 7;
}

.portrait {
  margin: 0;
}
.portrait__slot {
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--s-1);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-2);
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, 0.9), transparent 60%),
    var(--conf-hatch),
    var(--paper-2);
  color: var(--ink-2);
  font-size: var(--t-sm);
}
.portrait__spec {
  color: var(--ink-3);
}
.who p {
  margin: 0 0 var(--s-4);
  color: var(--ink-2);
}
.facts {
  margin: 0 0 var(--s-5);
  display: grid;
  gap: var(--s-2);
}
.facts div {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: baseline;
  gap: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}
.facts dt {
  color: var(--ink-3);
}
.facts dd {
  margin: 0;
}

.for-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.for {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  transition: background var(--d-med), box-shadow var(--d-med);
}
html[data-audience="particulier"] .for[data-for="particulier"],
html[data-audience="entreprise"] .for[data-for="entreprise"] {
  background: var(--thread-soft);
  box-shadow: inset 0 0 0 1px rgba(44, 57, 214, 0.2);
}
.for .tile__title {
  font-size: var(--t-xl);
}
.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.ticks li {
  position: relative;
  padding-left: 22px;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--thread);
  border-bottom: 2px solid var(--thread);
  transform: rotate(-45deg);
}
.todo-chip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  margin: var(--s-5) 0 0;
  padding: 6px 12px;
  border-radius: var(--r-md);
  background: var(--ember-soft);
  color: #7a2e12;
  font-size: var(--t-sm);
}
.todo-chip .mono {
  font-weight: 500;
}

.path {
  list-style: none;
  margin: var(--s-4) 0;
  padding: 0;
  display: grid;
}
.path li {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--line);
}
.path li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--sheet);
  border: 2px solid var(--thread);
}
.path li::after {
  content: "";
  position: absolute;
  left: 10px;
  top: calc(50% + 6px);
  height: calc(100% - 12px);
  width: 1.5px;
  background: var(--thread);
  opacity: 0.35;
}
.path li:last-child::after {
  display: none;
}
.path .mono {
  color: var(--ink-3);
}
.fine {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--ink-2);
}

.mini-ui {
  display: grid;
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-5);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--line);
  max-width: 420px;
}
.mini-ui__status {
  display: grid;
  gap: 2px;
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--sheet);
  box-shadow: var(--sh-1);
}
.mini-ui__status .mono {
  color: var(--thread);
}
.mini-ui__row {
  padding: 10px var(--s-3);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  background: var(--sheet);
}
.mini-ui__row--todo {
  background: var(--ember-soft);
  color: #7a2e12;
}
.mini-ui__row--ok {
  background: var(--sage-soft);
  color: #1e4a33;
}
.progress {
  display: block;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  overflow: hidden;
  margin-top: 6px;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--thread);
}
.tile--space .ticks {
  margin-bottom: var(--s-5);
}
.link-arrow {
  color: var(--thread);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ============ FORMULAIRE ============ */
.demande {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 96px);
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--s-9) clamp(16px, 4vw, 56px) var(--s-10);
  scroll-margin-top: 40px;
}
.demande__intro .sec-title {
  font-size: clamp(2.6rem, 1.4rem + 4vw, 5.2rem);
  margin-bottom: var(--s-4);
}
.reassure {
  list-style: none;
  padding: 0;
  margin: var(--s-6) 0;
  display: grid;
  gap: var(--s-3);
  color: var(--ink-2);
}
.reassure li {
  position: relative;
  padding-left: 22px;
}
.reassure .dot {
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--thread);
}
.warn {
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--ember);
  background: var(--ember-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--t-sm);
  color: #5c230e;
}

.intake {
  padding: clamp(20px, 3vw, 40px);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  align-self: start;
}
.intake__steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
  margin: 0 0 var(--s-6);
  padding: 0;
  font-size: var(--t-xs);
  color: var(--ink-3);
}
.intake__steps li {
  padding-top: var(--s-2);
  border-top: 3px solid var(--paper-3);
  transition: border-color var(--d-med), color var(--d-med);
}
.intake__steps li.is-done {
  border-color: var(--thread);
  color: var(--ink-2);
}
.intake__steps li[aria-current="step"] {
  border-color: var(--thread);
  color: var(--ink);
  font-weight: 600;
}
.intake__panel {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.intake__q {
  display: block;
  margin: 0 0 var(--s-5);
  padding: 0;
  font-family: var(--f-display);
  font-size: var(--t-2xl);
  line-height: 1.1;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice__box {
  display: grid;
  gap: 2px;
  padding: var(--s-5) var(--s-4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--d-fast), background var(--d-fast), transform var(--d-fast);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.choice__box strong {
  font-size: var(--t-lg);
  color: var(--ink);
}
.choice__box svg {
  width: 28px;
  height: 28px;
  margin-bottom: var(--s-2);
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.choice:hover .choice__box {
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.choice input:checked + .choice__box {
  border-color: var(--thread);
  background: var(--thread-soft);
}
.choice input:checked + .choice__box svg {
  stroke: var(--thread);
}
.choice input:focus-visible + .choice__box {
  box-shadow: var(--focus);
}

.field {
  display: grid;
  gap: 6px;
  margin: 0 0 var(--s-5);
  border: 0;
  padding: 0;
  min-width: 0;
}
.field > label,
.field > legend {
  font-weight: 500;
  font-size: var(--t-sm);
  padding: 0;
  margin-bottom: 6px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
.opt {
  font-weight: 400;
  color: var(--ink-3);
}
input:not([type="radio"]):not([type="checkbox"]),
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: var(--t-md);
  transition: border-color var(--d-fast), box-shadow var(--d-fast);
}
textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.5;
}
input:hover,
textarea:hover {
  border-color: var(--line-2);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--thread);
  box-shadow: 0 0 0 4px var(--thread-soft);
}
[aria-invalid="true"] {
  border-color: var(--danger) !important;
  background: #fffafa !important;
}
.hint {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.field-error {
  margin: 4px 0 0;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: var(--t-sm);
  color: var(--danger);
  font-weight: 500;
}
.field-error[hidden] {
  display: none;
}
.field-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.seg label {
  position: relative;
}
.seg input {
  position: absolute;
  opacity: 0;
}
.seg span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: var(--t-sm);
}
.seg input:checked + span {
  border-color: var(--thread);
  background: var(--thread-soft);
  color: var(--thread-2);
  font-weight: 500;
}
.seg input:focus-visible + span {
  box-shadow: var(--focus);
}
.consent {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font-size: var(--t-sm);
  color: var(--ink-2);
  cursor: pointer;
}
.consent input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--thread);
  flex: none;
}
.consent a {
  color: var(--thread);
}
.recap {
  margin: 0;
  display: grid;
}
.recap div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}
.recap dt {
  color: var(--ink-3);
  font-size: var(--t-sm);
}
.recap dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.intake__nav {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.intake__nav [data-action="prev"] {
  margin-right: auto;
}
.intake__done {
  outline: none;
}
.done-mark {
  width: 64px;
  height: 64px;
  margin-bottom: var(--s-4);
  fill: none;
  stroke: var(--sage);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.done-mark circle {
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  animation: draw 700ms var(--ease-out) forwards;
}
.done-mark path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 400ms 500ms var(--ease-out) forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.ref-line {
  color: var(--ink-2);
}
.intake.is-done .intake__nav,
.intake.is-done .intake__steps {
  display: none;
}

/* ============ PIED DE PAGE ============ */
.site-footer {
  position: relative;
  z-index: 2;
  padding: var(--s-9) clamp(16px, 4vw, 56px) var(--s-6);
  background: var(--ink);
  color: #d9d5cc;
}
.footer-line {
  max-width: 1320px;
  margin: 0 auto var(--s-8);
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 1rem + 5vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: #fbf8f2;
}
.footer-line em {
  color: #9aa2ff;
}
.footer-cols {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-6);
  font-size: var(--t-sm);
}
.site-footer .kicker {
  color: #8f8b83;
}
.site-footer a {
  color: #fbf8f2;
}
.site-footer .placeholder {
  color: #b5b0a6;
  border-color: #5a5750;
  background: transparent;
}
.site-footer .btn--ghost {
  --btn-fg: #fbf8f2;
  border-color: #5a5750;
}
.site-footer .btn--ghost:hover {
  --btn-bg: #24272e;
}
.site-footer .btn--ghost[aria-pressed="true"] {
  --btn-bg: #fbf8f2;
  --btn-fg: var(--ink);
}
.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}
.footer-fine {
  max-width: 1320px;
  margin: var(--s-8) auto 0;
  padding-top: var(--s-4);
  border-top: 1px solid #33363d;
  color: #8f8b83;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .site-nav {
    display: none;
  }
  .tile--who,
  .tile--for,
  .tile--how,
  .tile--space {
    grid-column: span 12;
  }
}
@media (max-width: 860px) {
  .demande {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .site-header {
    gap: var(--s-3);
    height: 56px;
  }
  .brand__role {
    display: none;
  }
  .brand__name {
    font-size: 1.2rem;
  }
  .site-header .audience {
    display: none;
  }
  .tile--who {
    grid-template-columns: 1fr;
  }
  .portrait__slot {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
  .for-grid,
  .choice-grid,
  .field-row {
    grid-template-columns: 1fr;
  }
  .recap div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .intake__nav .btn {
    flex: 1;
  }
  .footer-cols {
    grid-template-columns: 1fr;
  }
  .proto-bar {
    font-size: 0.7rem;
  }
}
