:root {
  --ink: #0e1b4d;
  --ink-soft: #2b3768;
  --muted: #5e6785;
  --line: #e2e5ee;
  --paper: #ffffff;
  --mist: #f5f7fa;
  --teal: #22b3c1;
  --teal-deep: #0b7c8a;
  --teal-wash: #e9f8f9;
  --orange: #e8701a;
  --error: #c2361f;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }
img { display: block; }
button, input, textarea { font: inherit; color: inherit; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ───── Layout ───── */

.shell {
  overflow-x: clip;
  display: grid;
  grid-template-columns: 41% 59%;
  min-height: 100vh;
  min-height: 100dvh;
  transition: grid-template-columns .9s var(--ease-io);
}

.shell[data-view="intro"] { grid-template-columns: 52% 48%; }

/* ───── Stage (photo side) ───── */

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 3vw, 44px);
}

.stage-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1s ease, transform 2.4s var(--ease);
}

.stage-photo.on { opacity: 1; transform: scale(1); }

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(14, 27, 77, .55) 0%,
    rgba(14, 27, 77, .08) 26%,
    rgba(14, 27, 77, .2) 42%,
    rgba(14, 27, 77, .68) 68%,
    rgba(14, 27, 77, .95) 100%);
}

.stage > * { position: relative; z-index: 1; }
.stage > .stage-photo { position: absolute; z-index: 0; }

.stage-tag {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.stage-tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 112, 26, .55); }
  50% { box-shadow: 0 0 0 7px rgba(232, 112, 26, 0); }
}

.stage-count {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .78);
  margin-bottom: 10px;
  min-height: 20px;
}

.stage-count b { color: #fff; font-weight: 600; }

.stage-title {
  font: 600 clamp(30px, 3.3vw, 50px)/1.06 var(--display);
  letter-spacing: -.02em;
  max-width: 15em;
  overflow: hidden;
  outline: none;
  padding-bottom: .08em;
}

.stage-title span { display: block; animation: title-in .85s var(--ease) both; }

@keyframes title-in {
  from { transform: translateY(105%); }
  to { transform: none; }
}

.stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.stage-partners {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

.progress {
  display: flex;
  gap: 6px;
  margin-top: clamp(18px, 2.4vw, 28px);
}

.seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
}

.seg i {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .8s var(--ease), background .4s ease;
}

.seg.full i { transform: scaleX(1); }
.seg.now i { transform: scaleX(.5); background: var(--teal); }

.stage-next {
  margin-top: 12px;
  min-height: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}

/* ───── Panel (form side) ───── */

.panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 5vw, 72px);
}

.logos { display: flex; align-items: center; gap: 18px; }
.logos img { height: 40px; width: auto; }
.logos .logo-axxam { height: 32px; }
.logos-sep { width: 1px; height: 28px; background: var(--line); }

.credit {
  max-width: 760px;
  padding: 18px clamp(20px, 5vw, 72px) 22px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.shell[data-view="step"] .credit { display: none; }

.outline {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  border-top: 1px solid var(--line);
}

.outline li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.outline span { color: var(--teal-deep); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.outline b { font-weight: 500; }

.step-intro { color: var(--muted); margin-bottom: 26px; font-size: 15.5px; }

.doc-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.doc-list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

.doc-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal);
}

/* Fichier */

.file { margin-top: 10px; }

.drop {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--mist);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s var(--ease);
}

.drop:hover, .drop.over { border-color: var(--teal-deep); background: var(--teal-wash); }
.drop.over { transform: scale(1.01); }
.file:has(input:focus-visible) .drop { outline: 2.5px solid var(--teal); outline-offset: 2px; }

.drop-icon, .file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  color: var(--teal-deep);
  box-shadow: 0 6px 16px -10px rgba(14, 27, 77, .45);
}

.drop-icon svg, .file-icon svg { width: 22px; height: 22px; }
.drop-text { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.drop-text b { color: var(--ink); font-size: 15.5px; font-weight: 600; }

.file-card { display: none; }

.file.has-file .drop { display: none; }

.file.has-file .file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--teal-deep);
  border-radius: 16px;
  background: var(--teal-wash);
  animation: pop .3s var(--ease) both;
}

.file-meta { display: grid; min-width: 0; flex: 1; font-size: 13.5px; color: var(--muted); }
.file-meta b { color: var(--ink); font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-remove {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.file-remove:hover { background: #fff; }

.preview-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--orange);
  background: #fdf1e8;
  border-radius: 99px;
  padding: 4px 11px;
  white-space: nowrap;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 760px;
  padding: clamp(10px, 2.4vh, 26px) clamp(20px, 5vw, 72px) 36px;
  transition: opacity .2s ease, transform .2s ease;
}

.view.leaving { opacity: 0; transform: translateX(calc(var(--dir, 1) * -22px)); }

.reveal {
  animation: rise .62s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 58ms);
}

@keyframes rise {
  from { opacity: 0; transform: translate(calc(var(--dir, 0) * 22px), 12px); }
  to { opacity: 1; transform: none; }
}

/* ───── Intro ───── */

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-deep);
  margin-bottom: 12px;
}

.intro h1 {
  font: 600 clamp(33px, 3.3vw, 50px)/1.06 var(--display);
  letter-spacing: -.022em;
  margin-bottom: 20px;
}

.lede { font-size: 18px; line-height: 1.45; font-weight: 500; margin-bottom: 12px; }
.intro p.body { color: var(--muted); margin-bottom: 12px; font-size: 15.5px; }

.intro-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
}

.intro-note { font-size: 14px; color: var(--muted); }

/* ───── Buttons ───── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background .25s ease, transform .2s var(--ease), box-shadow .3s ease;
}

.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.btn:hover { background: #18296b; box-shadow: 0 10px 26px -12px rgba(14, 27, 77, .7); }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .65; cursor: progress; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
}

.btn-ghost:hover { background: var(--mist); box-shadow: none; }
.btn-ghost:hover svg { transform: translateX(-4px); }

.spin {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }

.nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(20px, 5vw, 72px) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 30%);
  max-width: 760px;
  width: 100%;
}

/* ───── Fields ───── */

.field { margin-bottom: 30px; }

.q {
  display: block;
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.req { color: var(--orange); margin-left: 3px; }
.hint { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }

.line {
  position: relative;
  margin-top: 4px;
}

.line input, .line textarea {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 10px 0 11px;
  outline: none;
  font-size: 17px;
  transition: border-color .25s ease;
}

.line textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.line input::placeholder, .line textarea::placeholder { color: #8d94ad; }

.line::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--ink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}

.line:focus-within::after { transform: scaleX(1); }

.has-error .line input, .has-error .line textarea { border-color: var(--error); }

.err {
  display: grid;
  grid-template-rows: 0fr;
  color: var(--error);
  font-size: 14px;
  transition: grid-template-rows .28s var(--ease);
}

.err > span { overflow: hidden; }
.has-error > .err { grid-template-rows: 1fr; }
.has-error > .err > span { padding-top: 6px; }

/* Options */

.opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.opts.inline { display: flex; flex-wrap: wrap; }
.opts.single { grid-template-columns: minmax(0, 1fr); }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
  user-select: none;
  transition: border-color .2s ease, background .2s ease, transform .2s var(--ease);
}

.opts.inline .opt { padding-right: 20px; }

.opt:hover { border-color: #b9c0d4; }
.opt:active { transform: scale(.985); }

.opt input { position: absolute; opacity: 0; pointer-events: none; }

.mark {
  flex: none;
  width: 20px; height: 20px;
  border: 1.5px solid #b4bbd0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  transition: background .2s ease, border-color .2s ease;
}

.mark.round { border-radius: 50%; }

.mark svg { width: 13px; height: 13px; }

.mark path {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset .3s var(--ease) .04s;
}

.opt input:checked ~ .mark { background: var(--teal-deep); border-color: var(--teal-deep); }
.opt input:checked ~ .mark path { stroke-dashoffset: 0; }
.opt:has(input:checked) { border-color: var(--teal-deep); background: var(--teal-wash); }
.opt:has(input:focus-visible) { outline: 2.5px solid var(--teal); outline-offset: 2px; }

/* Reveal blocks */

.fold {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  opacity: 0;
  transition: grid-template-rows .38s var(--ease), opacity .3s ease, visibility .38s;
}

.fold > div { overflow: hidden; min-height: 0; }
.fold.open { grid-template-rows: 1fr; visibility: visible; opacity: 1; }
.fold .field { margin-bottom: 30px; }
.fold .other { padding-top: 6px; }

/* Combobox */

.combo { position: relative; }

.combo-list {
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  top: calc(100% + 6px);
  max-height: 264px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 44px -22px rgba(14, 27, 77, .4);
  transform-origin: top;
  animation: pop .22s var(--ease) both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.combo-list li {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.combo-list li small {
  width: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

.combo-list li.active { background: var(--teal-wash); }
.combo-empty { padding: 12px; color: var(--muted); font-size: 14px; }

/* Notices */

.notice {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s var(--ease);
}

.notice > div { overflow: hidden; }
.notice.open { grid-template-rows: 1fr; }

.notice p {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdeeea;
  color: #8f2614;
  font-size: 14.5px;
}

.consent-text { color: var(--ink-soft); margin-bottom: 18px; }

.send-error { margin-top: 2px; }

/* ───── Success ───── */

.done { padding-top: clamp(16px, 8vh, 90px); }

.done-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: var(--teal-deep);
  box-shadow: 0 0 0 10px var(--teal-wash);
}

.done-badge svg { width: 28px; height: 28px; }

.done-badge path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.done h1 {
  font: 600 clamp(32px, 3.4vw, 48px)/1.08 var(--display);
  letter-spacing: -.02em;
  margin-bottom: 14px;
}

.done p { color: var(--muted); font-size: 18px; max-width: 30em; }
[tabindex="-1"]:focus { outline: none; }

/* ───── Phone & small tablet ───── */

@media (max-width: 860px) {
  .shell, .shell[data-view="intro"] { display: block; }

  .stage {
    position: relative;
    height: auto;
    min-height: 250px;
    padding: 18px 20px 16px;
    justify-content: flex-end;
  }

  .stage::after {
    background: linear-gradient(180deg, rgba(14, 27, 77, .15) 0%, rgba(14, 27, 77, .35) 40%, rgba(14, 27, 77, .92) 100%);
  }

  .shell[data-view="intro"] .stage, .shell[data-view="done"] .stage { min-height: 270px; justify-content: space-between; }
  .shell[data-view="step"] .stage-top { display: none; }
  .stage-partners { display: none; }
  .stage-title { font-size: 27px; }
  .stage-count { margin-bottom: 4px; }
  .progress { margin-top: 14px; }
  .stage-next { margin-top: 8px; }
  .outline { grid-template-columns: minmax(0, 1fr); }
  .drop { padding: 18px; }

  .panel { min-height: 0; }
  .bar { padding: 16px 20px 12px; }
  .logos img { height: 34px; }
  .logos .logo-axxam { height: 27px; }
  .preview-badge { position: fixed; z-index: 30; top: 10px; right: 10px; }
  .view { padding: 14px 20px 24px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .nav { padding-left: 20px; padding-right: 20px; }
  .line input, .line textarea { font-size: 16px; }
  .intro-cta .btn { width: 100%; }
  .done { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
