/* OCD Live : design system « Nuit de studio ».
   Partagé par la vitrine (/) et le parcours (/reserver, /reservation).
   Règle : on ajoute des jetons ou des composants, on ne renomme jamais ceux qui existent. */

/* ---------- Police ---------- */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2-variations"),
    url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  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;
}

/* Repli aux métriques ajustées : le passage à Bricolage ne décale pas la page. */
@font-face {
  font-family: "Bricolage repli";
  src: local("Arial"), local("ArialMT"), local("Roboto"), local("Helvetica");
  size-adjust: 100%;
  ascent-override: 93%;
  descent-override: 27%;
  line-gap-override: 0%;
}

/* ---------- Jetons ---------- */

:root {
  color-scheme: dark;

  /* Couleurs */
  --nuit: #120D0A;
  --plateau: #1D1612;
  --coulisse: #2A211B;
  --creme: #FFF4EA;
  --sable: #B9A89A;
  --cendre: #7D6E63;
  --orange: #F06800;
  --orange-survol: #FF7A1A;
  --lueur: #FF9A3D;
  --braise: #A84800;
  --voile: rgb(240 104 0 / 0.16);
  --voile-dense: rgb(240 104 0 / 0.24);
  --filigrane: #DB5F00;
  --alerte: #FF7A66;
  --filet: rgb(255 244 234 / 0.10);
  --filet-fort: rgb(255 244 234 / 0.16);
  /* États (parcours et confirmation) */
  --succes: #7ED69A;
  --attente: #F5C451;
  --direct: var(--orange);

  /* Typographie */
  --police: "Bricolage Grotesque", "Bricolage repli", system-ui, sans-serif;
  --t-affiche: clamp(2.125rem, 1.4rem + 3.4vw, 4.5rem);
  --t-final: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  --t-titre: clamp(1.75rem, 1.25rem + 2.2vw, 3rem);
  --t-citation: clamp(1.5rem, 1.15rem + 1.75vw, 2.5rem);
  --t-sous-titre: clamp(1.3125rem, 1.2rem + 0.35vw, 1.5rem);
  --t-intro: clamp(1rem, 0.9rem + 0.6vw, 1.3125rem);
  --t-corps: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --t-petit: 0.875rem;
  --t-micro: 0.75rem;

  /* Espacements */
  --marge: 20px;                 /* 16px < 375px, 32px >= 768px, 40px >= 1024px */
  --section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --apres-titre: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  --largeur: 1200px;
  --largeur-hero: 1280px;

  /* Rayons */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --r-xl: 32px;
  --r-pilule: 999px;

  /* Profondeur */
  --ombre-carte: inset 0 1px 0 rgb(255 244 234 / 0.06), 0 1px 2px rgb(0 0 0 / 0.4);
  --ombre-flottante: 0 12px 32px -8px rgb(0 0 0 / 0.6);
  --relief: 4px;

  /* Mouvement */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-tiroir: cubic-bezier(0.32, 0.72, 0, 1);
  --d-appui: 120ms;
  --d-survol: 150ms;
  --d-ouverture: 220ms;
  --d-barre: 280ms;
  --d-entree: 500ms;
  --d-trace: 1400ms;

  /* Alias des jetons de mouvement du parcours (spec-parcours 1.2) */
  --duree-appui: var(--d-appui);
  --duree-etat: 150ms;
  --duree-entree: 220ms;
  --duree-deplacement: 200ms;
  --duree-feuille: 300ms;
  --delai-avance: 180ms;
  --courbe-sortie: var(--ease-out);
  --courbe-deplacement: var(--ease-in-out);
  --courbe-feuille: var(--ease-tiroir);
}

@media (max-width: 374.98px) {
  :root { --marge: 16px; }
}
@media (min-width: 768px) {
  :root { --marge: 32px; }
}
@media (min-width: 1024px) {
  :root { --marge: 40px; }
}

/* ---------- Socle ---------- */

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--nuit);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--nuit);
  color: var(--creme);
  font-family: var(--police);
  font-size: var(--t-corps);
  font-weight: 400;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, p, figure, blockquote, ol, ul, dl, dd {
  margin: 0;
}

h1, h2, h3, h4 {
  font-weight: 700;
  text-wrap: balance;
  hyphens: manual;
}

p {
  text-wrap: pretty;
}

ol, ul {
  padding: 0;
  list-style: none;
}

img, svg, picture, video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--orange);
  color: var(--nuit);
}

/* Contrôles : pas de sélection de texte ni de délai de toucher. Jamais sur le texte courant. */
a, button, summary, label, [role="button"], [role="tab"], .pastille, .pilule {
  touch-action: manipulation;
}
button, summary, [role="button"], [role="tab"], .bouton, .tuile, .pastille-heure, .puce-jour {
  user-select: none;
  -webkit-user-select: none;
}
/* Cartes entières cliquables : l'appui long ne sélectionne pas leur texte
   et n'ouvre pas l'aperçu de lien iOS. Une carte qui n'est pas un lien reste sélectionnable. */
a.carte, a.carte-live-corps, .tuile {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.chiffres {
  font-variant-numeric: tabular-nums;
}

/* ---------- Focus ---------- */

:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--lueur);
  outline-offset: 3px;
}
.sur-orange :focus-visible {
  outline-color: var(--nuit);
}

/* ---------- Typographie ---------- */

.t-affiche {
  font-size: var(--t-affiche);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.t-titre {
  font-size: var(--t-titre);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.t-sous-titre {
  font-size: var(--t-sous-titre);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.t-intro {
  font-size: var(--t-intro);
  line-height: 1.45;
  color: var(--sable);
}
.t-petit {
  font-size: var(--t-petit);
  line-height: 1.4;
}
.t-micro {
  font-size: var(--t-micro);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.sable {
  color: var(--sable);
}

/* Lien texte */
.lien {
  color: var(--creme);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--d-survol) ease;
}
@media (hover: hover) and (pointer: fine) {
  .lien:hover { color: var(--lueur); }
}

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-pilule);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--d-appui) var(--ease-out),
    background-color var(--d-survol) ease,
    border-color var(--d-survol) ease,
    color var(--d-survol) ease;
}
@media (min-width: 1024px) {
  .bouton { min-height: 52px; }
}
.bouton:active {
  transform: scale(0.97);
}
.bouton svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Principal : pilule Orange, texte Nuit */
.bouton-principal {
  background: var(--orange);
  color: var(--nuit);
}
/* Secondaire : pilule transparente, contour Cendre */
.bouton-secondaire {
  background: transparent;
  border-color: var(--cendre);
  color: var(--creme);
}
/* Sur Orange : pilule Nuit, texte Crème */
.bouton-nuit {
  min-height: 56px;
  background: var(--nuit);
  color: var(--creme);
  font-size: 1.0625rem;
}
.bouton-petit {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.9375rem;
}
.bouton-large {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .bouton-principal:hover { background: var(--orange-survol); }
  .bouton-secondaire:hover { border-color: var(--creme); }
  .bouton-nuit:hover { background: var(--plateau); }
}

.bouton:disabled,
.bouton[aria-disabled="true"] {
  cursor: not-allowed;
  transform: none;
}
.bouton-principal:disabled,
.bouton-principal[aria-disabled="true"] {
  background: var(--coulisse);
  color: var(--cendre);
}
.bouton-secondaire:disabled,
.bouton-secondaire[aria-disabled="true"] {
  border-color: var(--filet);
  color: var(--cendre);
}

/* ---------- Tuile en relief (procédé Duolingo) ----------
   <a class="tuile"><span class="tuile-face">…</span></a>
   Le socle Braise reste fixe, la face descend à l'appui. */

.tuile {
  position: relative;
  display: block;
  padding-bottom: var(--relief);
  border-radius: var(--r-l);
  background: var(--braise);
  color: var(--nuit);
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}
.tuile-face {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--r-l);
  background: var(--orange);
  color: var(--nuit);
  transform: translateY(0);
  transition:
    transform var(--d-appui) var(--ease-out),
    background-color var(--d-survol) ease;
}
.tuile:active .tuile-face {
  transform: translateY(3px);
}
@media (hover: hover) and (pointer: fine) {
  .tuile:hover .tuile-face { background: var(--orange-survol); }
}
.tuile:focus-visible {
  outline: 2px solid var(--lueur);
  outline-offset: 3px;
}

/* ---------- Pilules et pastilles ---------- */

/* Pastille d'information : pilule 32 px, fond Voile, point Orange statique */
.pastille {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px 0 12px;
  border-radius: var(--r-pilule);
  background: var(--voile);
  color: var(--creme);
  font-size: var(--t-petit);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--d-survol) ease;
}
.pastille::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--orange);
}
.pastille.sans-point::before {
  content: none;
}
@media (hover: hover) and (pointer: fine) {
  a.pastille:hover { background: var(--voile-dense); }
}

/* Badge : petite étiquette d'état (rayon s) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--r-s);
  background: var(--coulisse);
  color: var(--creme);
  font-size: var(--t-micro);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* Badge « En direct » : pilule Orange, texte Nuit, point qui pulse */
.en-direct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-pilule);
  background: var(--direct);
  color: var(--nuit);
  font-size: var(--t-micro);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.en-direct::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nuit);
  animation: pulsation 1600ms ease-in-out infinite alternate;
}
@keyframes pulsation {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

/* Pastille d'heure libre : pilule 48 px, contour Cendre */
.pastille-heure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--r-pilule);
  border: 1px solid var(--cendre);
  background: transparent;
  color: var(--creme);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--d-appui) var(--ease-out),
    background-color var(--d-survol) ease,
    border-color var(--d-survol) ease;
}
.pastille-heure:active {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  a.pastille-heure:hover,
  button.pastille-heure:hover:not([aria-disabled="true"]) {
    border-color: var(--orange);
    background: var(--voile);
  }
}
.pastille-heure[aria-pressed="true"] {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--nuit);
}
/* Heure prise : contour pointillé, sans fond, texte Cendre + mention « Pris ».
   La forme reste visible sur une bande Plateau. */
.pastille-heure[aria-disabled="true"],
.pastille-heure.prise {
  border-style: dashed;
  border-color: var(--filet-fort);
  background: transparent;
  color: var(--cendre);
  cursor: default;
  transform: none;
}
.pastille-heure .mention {
  font-size: var(--t-micro);
  font-weight: 500;
}

/* Puce jour : 56 x 72, fond Coulisse */
.puce-jour {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  min-height: 72px;
  padding: 6px 0;
  border-radius: var(--r-m);
  border: 1px solid var(--filet);
  background: var(--coulisse);
  color: var(--creme);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  transition:
    transform var(--d-appui) var(--ease-out),
    background-color var(--d-survol) ease,
    border-color var(--d-survol) ease;
}
.puce-jour strong {
  font-size: 1.3125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.puce-jour:active {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  .puce-jour:hover { border-color: var(--filet-fort); }
}
.puce-jour[aria-pressed="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--nuit);
}
.puce-jour.complet,
.puce-jour[aria-disabled="true"] {
  color: var(--sable);
}
.puce-jour.complet strong,
.puce-jour[aria-disabled="true"] strong {
  color: var(--cendre);
}

/* ---------- Cartes et panneaux ---------- */

.carte {
  position: relative;
  padding: 20px;
  border-radius: var(--r-m);
  border: 1px solid var(--filet);
  background: var(--plateau);
  box-shadow: var(--ombre-carte);
}
a.carte,
button.carte {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition:
    transform var(--d-appui) var(--ease-out),
    border-color var(--d-survol) ease;
}
a.carte:active,
button.carte:active {
  transform: scale(0.985);
}
@media (hover: hover) and (pointer: fine) {
  a.carte:hover,
  button.carte:hover { border-color: var(--orange); }
}
.carte[aria-pressed="true"],
.carte.choisie {
  border-color: var(--orange);
  background: linear-gradient(var(--voile), var(--voile)), var(--plateau);
}

.panneau {
  padding: 10px;
  border-radius: var(--r-xl);
  border: 1px solid var(--filet);
  background: var(--plateau);
  box-shadow: var(--ombre-carte);
}

/* Encart orangé (mention, aide) */
.encart {
  padding: 14px 16px;
  border-radius: var(--r-m);
  background: var(--voile);
  color: var(--creme);
  font-size: var(--t-petit);
  line-height: 1.45;
}

.filet {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--filet);
}

/* ---------- Formulaires ---------- */

.champ {
  display: grid;
  gap: 8px;
}
.champ > label,
.libelle {
  color: var(--creme);
  font-size: var(--t-petit);
  font-weight: 600;
  line-height: 1.3;
}
.aide {
  color: var(--sable);
  font-size: var(--t-petit);
  line-height: 1.4;
}

.saisie,
.champ input:not([type="checkbox"]):not([type="radio"]),
.champ select,
.champ textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--r-m);
  border: 1px solid var(--cendre);
  background: var(--nuit);
  color: var(--creme);
  font-size: 16px; /* jamais moins : iOS zoomerait */
  line-height: 1.3;
  transition:
    border-color var(--d-survol) ease,
    box-shadow var(--d-survol) ease;
}
.champ textarea,
textarea.saisie {
  min-height: 104px;
  padding: 14px 16px;
  resize: vertical;
}
.saisie::placeholder,
.champ input::placeholder,
.champ textarea::placeholder {
  color: var(--sable);
  opacity: 0.75;
}
.saisie:focus-visible,
.champ input:not([type="checkbox"]):not([type="radio"]):focus-visible,
.champ select:focus-visible,
.champ textarea:focus-visible {
  outline: none;
  border-color: var(--lueur);
  box-shadow: 0 0 0 2px var(--lueur);
}
.saisie[aria-invalid="true"],
.champ [aria-invalid="true"] {
  border-color: var(--alerte);
}
.erreur {
  color: var(--alerte);
  font-size: var(--t-petit);
  line-height: 1.4;
}

/* Case à cocher 24 px, cible de 44 px */
.case {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  color: var(--sable);
  font-size: var(--t-petit);
  line-height: 1.45;
  cursor: pointer;
}
.case input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  margin: -2px 0 0;
  border-radius: 7px;
  border: 1px solid var(--cendre);
  background: var(--nuit);
  cursor: pointer;
  transition:
    background-color var(--d-survol) ease,
    border-color var(--d-survol) ease;
}
.case input::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: solid var(--nuit);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0.6);
  opacity: 0;
  transition:
    opacity var(--d-appui) var(--ease-out),
    transform var(--d-appui) var(--ease-out);
}
.case input:checked {
  background: var(--orange);
  border-color: var(--orange);
}
.case input:checked::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}
.case input:focus-visible {
  outline: 2px solid var(--lueur);
  outline-offset: 3px;
}
.case input[aria-invalid="true"] {
  border-color: var(--alerte);
}

/* Piège à robots : hors de l'écran, jamais focalisable */
.piege {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Icônes (Lucide, trait 2 px) ---------- */

.icone {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icone-20 {
  width: 20px;
  height: 20px;
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  .en-direct::before { animation: none; }
  .bouton:active,
  .pastille-heure:active,
  .puce-jour:active,
  a.carte:active,
  button.carte:active { transform: none; }
}
