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

:root {
  --noir: #000;
  --encre: #121419;
  --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;
  /* Couleur secondaire d'Odra : le bleu #2E57E7, seule couleur d'accent de l'interface
     (décision de Joseph du 29/10/2026 : « Odrahost blanc et bleu »). Blanc dessus et bleu sur blanc : 5,8:1.
     Les teintes claires et foncées en dérivent (même teinte, clarté OKLCH déplacée). */
  --secondaire: #2E57E7;
  --secondaire-survol: #2549C9;
  --secondaire-appui: #1835B3;
  --secondaire-pale: #EFF4FF;
  --secondaire-pale-2: #DFEAFF;
  --secondaire-bord: #B5CDFF;
  --secondaire-texte: #294288; /* texte sur bleu pâle : 8,5:1 */
  --secondaire-clair: #8DAFFE; /* bleu lisible sur fond sombre : 7,7:1 sur #1b1e26 */
  --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 */
  --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(--secondaire);

  color-scheme: light;
  accent-color: var(--secondaire);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
  /* Un élément atteint au clavier ne s'arrête pas sous un bouton flottant en bas d'écran. */
  scroll-padding-bottom: 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(--secondaire-pale-2); color: var(--encre); }

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

.sombre { --focus: var(--secondaire-clair); 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(--secondaire);
  color: #fff;
  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 : le bouton plein est bleu ; « btn-jaune », ancien nom gardé pour l'espace client, rend le même bouton. */
.btn {
  --fond: var(--secondaire);
  --texte: #fff;
  --fond-survol: var(--secondaire-survol);
  --fond-appui: var(--secondaire-appui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  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 { background: var(--fond-appui, var(--fond-survol)); 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(--encre); --fond-survol: var(--gris-150); --fond-appui: var(--gris-200); }
.btn-jaune { --fond: var(--secondaire); --texte: #fff; --fond-survol: var(--secondaire-survol); --fond-appui: var(--secondaire-appui); }
.btn-noir { --fond: var(--encre); --texte: var(--blanc); --fond-survol: var(--gris-800); --fond-appui: var(--gris-700); }
.btn-contour { --fond: transparent; --texte: var(--encre); --fond-survol: var(--gris-50); --fond-appui: var(--gris-100); border-color: var(--gris-300); }
.btn-contour:hover { border-color: var(--encre); }
.sombre .btn-contour, .btn-contour.sur-sombre { --texte: var(--blanc); --fond-survol: rgb(255 255 255 / 0.08); --fond-appui: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.45); }
.sombre .btn-contour:hover, .btn-contour.sur-sombre:hover { border-color: var(--blanc); }
.btn-gris { --fond: var(--gris-100); --texte: var(--encre); --fond-survol: var(--gris-150); --fond-appui: var(--gris-200); }
.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); --fond-appui: 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 { margin: 0; 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); }
/* L'anneau plein passe devant le halo pâle : c'est lui qui marque le champ actif. */
.saisie:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--secondaire); box-shadow: 0 0 0 1px var(--secondaire), 0 0 0 4px var(--secondaire-pale-2); 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(--secondaire); }
.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, .pastille-bleue { background: var(--secondaire-pale); color: var(--secondaire-texte); }
.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(--secondaire-clair); 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); }
/* En colonne : seul le corps défile, la tête et les boutons du pied restent visibles même sur un petit écran. */
dialog.fenetre[open] { display: flex; flex-direction: column; overflow: hidden; animation: fenetre-entree 240ms var(--sortie); }
dialog.fenetre > form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
@keyframes fenetre-entree { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.fenetre-tete { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.fenetre-tete h2 { font-size: 1.375rem; }
.fenetre-corps { flex: 1 1 auto; min-height: 0; padding: 16px 24px 24px; display: grid; gap: 16px; overflow-y: auto; overscroll-behavior: contain; }
.fenetre-pied { display: flex; flex: none; 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;
  flex: none;
  border: 0; border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
@media (hover: hover) { .bouton-fermer:hover { background: var(--gris-100); } }

/* Toucher : pas de rectangle gris du navigateur ; un retour visible à l'appui à la place. */
a, summary, button { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  :where(a, summary):not(.btn):active { opacity: 0.7; }
  .bouton-fermer:active { background: var(--gris-100); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    /* 0 s et non 0,01 ms : une visibilité héritée qui « transitionne » 0,01 ms laisse un lien caché au moment
       où le tiroir lui donne le focus (R5-03). */
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* Exports officiels autonomes transparents, même cadrage et taille que Studio. */
.marque-hosting, .marque-studio { position: relative; display: block; flex: none; width: 150px; aspect-ratio: 15 / 7; overflow: hidden; background: transparent; }
.marque-hosting > img, .marque-studio > img { display: block; width: 100%; max-width: none; height: 100%; object-fit: contain; }
/* PNG noir RGBA : transparence native, sans filtre de rendu. */
.marque-hosting img { filter: none; }
.pied-marque .marque-hosting { width: 160px; }
.barre-logo .marque-hosting { width: 96px; }
.marque-studio { width: 96px; }
@media (max-width: 767px) { .entete-logo .marque-hosting { width: 110px; } }
@media (max-width: 375px) {
  .entete-logo .marque-hosting { width: 90px; }
  .marque-studio { width: 88px; }
}

/* Marque Odratta (06/11/2026, Joseph : « Odratta Hosting devient Odratta ») :
   le mot-symbole original de la charte (849:178, tracé de
   marque/da-odratta/assets/logo-odratta.svg, seule la couleur passe au noir),
   sans « hosting » dessous. */
.marque-odratta { display: block; flex: none; width: 128px; aspect-ratio: 849 / 178; }
.marque-odratta > img { display: block; width: 100%; height: 100%; max-width: none; }
.cartouche-marque .marque-odratta { width: 120px; }
.barre-logo .marque-odratta { width: 88px; }
html[data-theme="sombre"] .barre-logo .marque-odratta img { filter: invert(1); }
@media (max-width: 767px) { .entete-logo .marque-odratta { width: 104px; } }
@media (max-width: 375px) { .entete-logo .marque-odratta { width: 88px; } }
