/* Odrahost : socle commun du site et de l'espace client (couleurs, typographie, boutons, champs). */

:root {
  --noir: #000;
  --encre: #141417;
  --gris-900: #1b1b1f;
  --gris-850: #232328;
  --gris-800: #2c2c32;
  --gris-700: #3d3d44;
  --gris-600: #56565e;
  --gris-500: #6b6b74;
  --gris-400: #9a9aa3;
  --gris-300: #c6c6cd;
  --gris-200: #e2e2e7;
  --gris-150: #ebebef;
  --gris-100: #f3f3f6;
  --gris-50: #f8f8fa;
  --blanc: #fff;
  --jaune: #ffd60a;
  --jaune-fonce: #ecc300;
  --jaune-pale: #fff4c2;
  --gris-sur-jaune: #66581a; /* texte discret sur fond jaune pâle : même teinte, assombrie (contraste 6,4:1) */
  --bleu-odratta: #2d5bff; /* le bleu des boutons d'odratta.com, réservé au bouton Espace client (blanc dessus : 5,2:1) */
  --bleu-odratta-survol: #3d68ff;
  --bleu-odratta-appui: #1c44e0;
  --bord-champ: #8a8a93; /* bordure des champs : 3,4:1 sur blanc, le minimum pour repérer un contrôle */
  --rouge-fonce: #95231a;
  --fond-whatsapp: #efeae2; /* fond des conversations WhatsApp illustrées */
  --jaune-bord: #f3e3a0;
  --ambre-texte: #5c3c00;
  --vert: #0f7a55;
  --vert-pale: #e2f4ec;
  --rouge: #b42d22;
  --rouge-pale: #fdeceb;
  --ambre: #8a5a00;
  --ambre-pale: #fff1d6;

  --police-titre: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --police-texte: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --rayon-s: 8px;
  --rayon: 12px;
  --rayon-l: 20px;
  --rayon-xl: 28px;
  --ombre-1: 0 1px 2px rgb(0 0 0 / 0.06), 0 1px 1px rgb(0 0 0 / 0.04);
  --ombre-2: 0 12px 32px -12px rgb(0 0 0 / 0.22), 0 2px 6px -2px rgb(0 0 0 / 0.08);
  --ombre-3: 0 24px 64px -24px rgb(0 0 0 / 0.35);

  --marge: clamp(16px, 5.5vw, 80px);
  --largeur: 1280px;
  --sortie: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: var(--encre);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--police-texte);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--encre);
  background: var(--blanc);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--encre);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
  font-kerning: normal;
}

::selection { background: var(--jaune); color: var(--noir); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.sombre { --focus: var(--jaune); color: var(--blanc); caret-color: var(--blanc); }

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

.lien-evitement {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--jaune);
  color: var(--noir);
  font-weight: 600;
  border-radius: var(--rayon-s);
  text-decoration: none;
}
.lien-evitement:focus { top: 12px; }

.conteneur {
  width: min(100% - 2 * var(--marge), var(--largeur));
  margin-inline: auto;
}

/* Icônes du sprite (les propriétés de trait passent au symbole par héritage) */
.ic {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-s { width: 16px; height: 16px; }
.ic-l { width: 24px; height: 24px; }

/* Boutons */
.btn {
  --fond: var(--noir);
  --texte: var(--blanc);
  --fond-survol: var(--gris-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--fond);
  color: var(--texte);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--sortie);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { background: var(--fond-survol); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-blanc { --fond: var(--blanc); --texte: var(--noir); --fond-survol: var(--gris-150); }
.btn-jaune { --fond: var(--jaune); --texte: var(--noir); --fond-survol: var(--jaune-fonce); }
.btn-contour { --fond: transparent; --texte: var(--encre); --fond-survol: var(--gris-100); border-color: var(--encre); }
.sombre .btn-contour, .btn-contour.sur-sombre { --texte: var(--blanc); --fond-survol: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.55); }
.btn-gris { --fond: var(--gris-100); --texte: var(--encre); --fond-survol: var(--gris-150); }
.btn-petit { min-height: 36px; padding: 0 14px; font-size: 0.875rem; border-radius: 8px; }
.btn-large { width: 100%; }
.btn-danger { --fond: var(--rouge); --texte: var(--blanc); --fond-survol: var(--rouge-fonce); }

.lien-fleche {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}
.lien-fleche .ic { transition: transform 200ms var(--sortie); }
@media (hover: hover) and (pointer: fine) {
  .lien-fleche:hover .ic { transform: translateX(3px); }
}

/* Champs */
.champ { display: grid; gap: 6px; }
.champ > label, .champ .etiquette { font-weight: 500; font-size: 0.9375rem; }
.champ .aide { font-size: 0.8125rem; color: var(--gris-500); }
.saisie {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--bord-champ);
  border-radius: 10px;
  background: var(--blanc);
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea.saisie { min-height: 120px; padding: 12px 14px; resize: vertical; }
select.saisie { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.saisie::placeholder { color: var(--gris-500); }
.saisie:hover { border-color: var(--gris-500); }
.saisie:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--encre); box-shadow: 0 0 0 3px var(--jaune-pale), 0 0 0 1px var(--encre); transition: none; }
.saisie[aria-invalid="true"] { border-color: var(--rouge); }
.erreur-champ { color: var(--rouge); font-size: 0.875rem; font-weight: 500; }

/* Interrupteur (role="switch") */
.interrupteur {
  position: relative;
  width: 44px; height: 26px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--gris-500);
  cursor: pointer;
  transition: background-color 180ms ease;
}
.interrupteur::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--blanc);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 220ms var(--sortie);
}
.interrupteur[aria-checked="true"] { background: var(--noir); }
.interrupteur[aria-checked="true"]::after { transform: translateX(18px); }

/* Pastilles */
.pastille {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.pastille-jaune { background: var(--jaune); color: var(--noir); }
.pastille-verte { background: var(--vert-pale); color: var(--vert); }
.pastille-rouge { background: var(--rouge-pale); color: var(--rouge); }
.pastille-ambre { background: var(--ambre-pale); color: var(--ambre); }
.pastille-grise { background: var(--gris-100); color: var(--gris-600); }
.pastille .point { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Messages éphémères */
.toasts {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--noir);
  color: var(--blanc);
  box-shadow: var(--ombre-3);
  font-size: 0.9375rem;
  pointer-events: auto;
  animation: toast-entree 260ms var(--sortie);
}
.toast .ic { color: var(--jaune); margin-top: 1px; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(8px); } }

/* Fenêtres de dialogue natives */
dialog.fenetre {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--rayon-l);
  background: var(--blanc);
  color: var(--encre);
  box-shadow: var(--ombre-3);
}
dialog.fenetre::backdrop { background: rgb(0 0 0 / 0.55); }
dialog.fenetre[open] { animation: fenetre-entree 240ms var(--sortie); }
@keyframes fenetre-entree { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.fenetre-tete h2 { font-size: 1.375rem; }
.fenetre-corps { padding: 16px 24px 24px; display: grid; gap: 16px; }
.fenetre-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; flex-wrap: wrap; }
.bouton-fermer {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.bouton-fermer:hover { background: var(--gris-100); }

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