/* Bône Cardiologie 3 — page d'inscription
   Flat inks only: white sheet, navy ink, slate stage, brick, ochre.
   The event banner on the stage is the one warm object on the page. */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-var-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #FFFFFF;
  --stock: #FFFFFF;
  --badge-stock: #FCFAF5;
  --ink: #1A2233;
  --ink-soft: #485268;
  --line: #747D92;
  --hair: #D9D3C5;
  --slate: #33405A;
  --slate-text: #CDD2DE;
  --brick: #A8362A;
  --ochre: #D9A036;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 0.625rem;
  --gutter: max(clamp(1.25rem, 4.4vw, 4rem), calc((100% - 44rem) / 2));

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--line) var(--paper);
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--brick);
}

::selection {
  background: var(--ochre);
  color: var(--ink);
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- Page frame ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(23.75rem, 44vw, 47.5rem);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "masthead stage"
    "sheet stage"
    "foot stage";
  min-height: 100vh;
  min-height: 100dvh;
}

.masthead {
  grid-area: masthead;
  padding: clamp(1.25rem, 4vh, 2.25rem) var(--gutter) 0;
}

.masthead__org {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.sheet {
  grid-area: sheet;
  padding: clamp(1.75rem, 5vh, 3.25rem) var(--gutter) 2rem;
}

.foot {
  grid-area: foot;
  padding: 0 var(--gutter) 1.75rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

/* ---------- Intro ---------- */

h1 {
  font-size: clamp(2.75rem, min(5.2vw, 8.2vh), 4.5rem);
  font-weight: 800;
  font-stretch: 90%;
  line-height: 0.94;
  letter-spacing: -0.025em;
}

h1 span {
  display: block;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.75rem;
  margin-top: 1.25rem;
}

.facts > div {
  position: relative;
  min-height: 2.5rem;
  padding-left: 3.25rem;
}

.facts dt {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Spot-ink marks, printed like the badge: navy mass, brick accent, stock cut-outs. */
.facts__icon {
  position: absolute;
  top: 50%;
  left: 0;
  width: 2.5rem;
  height: 2.5rem;
  transform: translateY(-50%);
}

.facts__ink {
  fill: var(--ink);
}

.facts__brick {
  fill: var(--brick);
}

.facts__stock {
  fill: var(--stock);
}

.facts__dim {
  fill: var(--line);
}

.facts dd {
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: 96%;
  line-height: 1.25;
  font-variant-numeric: lining-nums;
}

.intro {
  max-width: 34rem;
  margin-top: 1.125rem;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* ---------- Form ---------- */

.form {
  margin-top: clamp(1.5rem, 4.2vh, 2.5rem);
}

.form__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1.5rem;
}

.form h2,
.done h2 {
  font-size: 1.375rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.form__hint {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 1.125rem;
}

.field {
  min-width: 0;
}

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 650;
}

.field__eg {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.control {
  display: block;
  width: 100%;
  height: 3rem;
  margin: 0;
  padding: 0 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--stock);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  transition: border-color 0.18s ease;
}

.control:hover {
  border-color: var(--ink);
}

.control:focus-visible {
  border-color: var(--ink);
  outline: 3px solid var(--slate);
  outline-offset: 2px;
}

.control[aria-invalid="true"] {
  border-width: 2px;
  border-color: var(--brick);
  padding-inline: calc(0.9rem - 0.5px);
}

.control:-webkit-autofill,
.control:-webkit-autofill:hover,
.control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--stock) inset;
  caret-color: var(--brick);
}

.control--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231A2233' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1rem 1rem;
  cursor: pointer;
  text-overflow: ellipsis;
}

.control--select[aria-invalid="true"] {
  padding-right: 2.6rem;
}

.control--select:invalid {
  color: var(--ink-soft);
}

.control--select option {
  background: var(--stock);
  color: var(--ink);
}

.field__extra {
  margin-top: 0.75rem;
}

.field__extra label {
  display: block;
  margin-bottom: 0.4rem;
}

.field__error {
  margin-top: 0.45rem;
  padding-left: 1.4rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23A8362A' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.2'/%3E%3Cpath d='M8 4.8v3.6M8 11v.2'/%3E%3C/svg%3E") no-repeat 0 0.08rem / 1rem 1rem;
  color: var(--brick);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}

.price-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label amount"
    "who amount"
    "adhesion adhesion";
  gap: 0.15rem 1.25rem;
  align-items: center;
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--stock);
}

.price-card__label {
  grid-area: label;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

.price-card__who {
  grid-area: who;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
}

.price-card__amount {
  grid-area: amount;
  justify-self: end;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  font-stretch: 92%;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.price-card__currency {
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0;
}

.price-card__adhesion {
  grid-area: adhesion;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "alabel aamount"
    "anote aamount";
  gap: 0.1rem 1rem;
  align-items: center;
  margin-top: 0.7rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hair);
}

.price-card__adhesion-label {
  grid-area: alabel;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.3;
}

.price-card__adhesion-amount {
  grid-area: aamount;
  justify-self: end;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.price-card__adhesion-note {
  grid-area: anote;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  font-style: italic;
}

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

.form__status {
  margin-top: 1.25rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: #F3DCD6;
  color: #74241B;
  font-size: 0.9375rem;
  font-weight: 600;
}

.form__actions {
  margin-top: 1.5rem;
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.5rem;
  padding: 0 1.5rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--stock);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  border-color: var(--slate);
  background: var(--slate);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid var(--slate);
  outline-offset: 3px;
}

.btn__icon {
  flex: none;
  transition: transform 0.3s var(--ease);
}

.form__actions .btn:hover .btn__icon {
  transform: translateX(3px);
}

.btn__spinner {
  display: none;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

.btn[aria-busy="true"] .btn__icon {
  display: none;
}

.btn[aria-busy="true"] .btn__spinner {
  display: block;
}

.btn--quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn--quiet:hover {
  border-color: var(--ink);
  background: transparent;
}

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

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

.done {
  margin-top: 2.5rem;
}

.done__mark {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.25rem;
}

.done__seal {
  width: 4.5rem;
  height: 4.5rem;
  overflow: visible;
}

.done__ring {
  stroke: var(--brick);
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
  transform-origin: 36px 36px;
}

.done__check {
  stroke: var(--ink);
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.done h2 {
  max-width: 30rem;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.done h2:focus {
  outline: none;
}

.done__lead {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

.recap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  max-width: 36rem;
  margin-top: 1.75rem;
}

.recap > div {
  padding-bottom: 0.15rem;
}

.recap dt {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

.recap dd {
  font-weight: 650;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Confirmation entrance: stamp, then cascade. */
.done.is-revealing .done__mark {
  animation: done-stamp 0.7s var(--ease) both;
}

.done.is-revealing .done__ring {
  animation: done-ring 0.75s var(--ease) 0.08s both;
}

.done.is-revealing .done__check {
  animation: done-check 0.45s var(--ease) 0.42s both;
}

.done.is-revealing h2,
.done.is-revealing .done__lead,
.done.is-revealing .done__demo,
.done.is-revealing .recap > div,
.done.is-revealing .done__actions {
  animation: done-rise 0.65s var(--ease) both;
}

.done.is-revealing h2 {
  animation-delay: 0.28s;
}

.done.is-revealing .done__lead {
  animation-delay: 0.4s;
}

.done.is-revealing .done__demo {
  animation-delay: 0.48s;
}

.done.is-revealing .recap > div:nth-child(1) { animation-delay: 0.52s; }
.done.is-revealing .recap > div:nth-child(2) { animation-delay: 0.58s; }
.done.is-revealing .recap > div:nth-child(3) { animation-delay: 0.64s; }
.done.is-revealing .recap > div:nth-child(4) { animation-delay: 0.7s; }
.done.is-revealing .recap > div:nth-child(5) { animation-delay: 0.76s; }
.done.is-revealing .recap > div:nth-child(6) { animation-delay: 0.82s; }
.done.is-revealing .recap > div:nth-child(7) { animation-delay: 0.88s; }
.done.is-revealing .recap > div:nth-child(n+8) { animation-delay: 0.94s; }

.done.is-revealing .done__actions {
  animation-delay: 1s;
}

@keyframes done-stamp {
  0% {
    opacity: 0;
    transform: scale(0.55) rotate(-12deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes done-ring {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes done-check {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes done-rise {
  from {
    opacity: 0;
    transform: translateY(0.85rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Stage and banner ---------- */

.stage {
  grid-area: stage;
  background-color: var(--slate);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='%233E4C6A' stroke-width='1'%3E%3Cpath d='M36 0 72 36 36 72 0 36Z'/%3E%3Crect x='10.54' y='10.54' width='50.92' height='50.92'/%3E%3C/svg%3E");
  background-position: center top;
  background-size: 4.5rem 4.5rem;
  color: var(--slate-text);
}

.stage__inner {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: clamp(1.25rem, 4vh, 2.5rem) clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
}

.banner {
  margin: 0;
  width: min(100%, 28rem);
  max-height: calc(100dvh - 3rem);
  overflow: hidden;
  border-radius: 0.875rem;
  background: #E5D3B3;
  box-shadow:
    0 1.6rem 2.4rem -1.2rem rgb(10 14 24 / 0.55),
    0 0.35rem 0.9rem rgb(10 14 24 / 0.28);
}

.banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 3rem);
  object-fit: contain;
  object-position: center top;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 56.25rem) {
  .page {
    display: block;
    min-height: 0;
  }

  .masthead {
    display: none;
  }

  .stage__inner {
    position: relative;
    height: auto;
    padding: 0 1.25rem 1.25rem;
  }

  .banner {
    width: min(100%, 22rem);
    max-height: none;
    margin-inline: auto;
  }

  .banner img {
    max-height: none;
  }

  h1 {
    font-size: 2.625rem;
  }

  .facts {
    gap: 0.75rem 2.75rem;
    margin-top: 1.125rem;
  }

  .intro {
    margin-top: 0.875rem;
    font-size: 1rem;
  }

  .control {
    height: 3.25rem;
  }

  .sheet {
    padding-top: 1.5rem;
  }

  .form {
    margin-top: 1.75rem;
  }
}

@media (max-width: 35rem) {
  .form__grid,
  .recap {
    grid-template-columns: minmax(0, 1fr);
  }

  .form__actions .btn,
  .done__actions .btn {
    width: 100%;
    padding-inline: 1rem;
  }
}

@media (max-width: 22.5rem) {
  .btn {
    font-size: 1rem;
  }
}

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

  .done__ring,
  .done__check {
    stroke-dashoffset: 0;
  }
}
