/* ============================================================
   MARCHÉO — BASE & RESET
   Reset moderne + comportement par défaut mobile-first
   À charger après marcheo-tokens.css
   ============================================================ */

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

/* Empêche le zoom auto iOS au focus d'un input < 16px */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compense le bounce iOS / Safari */
  overscroll-behavior-y: none;
}

body {
  font-family: var(--m-font-body);
  font-size: var(--m-text-base);
  line-height: var(--m-leading-base);
  color: var(--m-bleu-fonce);
  background: var(--m-creme);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

/* TYPOGRAPHIE ─────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--m-font-display);
  line-height: var(--m-leading-tight);
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--m-bleu-nuit);
}

p { line-height: var(--m-leading-base); }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(91, 190, 58, 0.2);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--m-vert);
  outline-offset: 2px;
}

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

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Touch targets — minimum 44×44 pour tous les éléments interactifs */
button, a.btn, [role="button"] {
  min-height: var(--m-touch-min);
}

input, select, textarea {
  font: inherit;
  font-size: 16px; /* CRITIQUE iOS — empêche le zoom auto */
  color: inherit;
  background: var(--m-blanc);
  border: 1.5px solid var(--m-creme-fonce);
  border-radius: var(--m-radius-md);
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--m-duration-fast);
  min-height: var(--m-touch-min);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--m-vert);
}

input::placeholder, textarea::placeholder {
  color: var(--m-gris-2);
}

/* Sélection de texte */
::selection {
  background: var(--m-vert);
  color: var(--m-blanc);
}

/* Scrollbars discrètes */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--m-creme-fonce);
  border-radius: var(--m-radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--m-gris-3); }

/* Safe areas iOS — appliquer aux éléments fixés en bas */
.m-safe-bottom {
  padding-bottom: calc(var(--m-space-3) + var(--m-safe-bottom));
}
.m-safe-top {
  padding-top: calc(var(--m-space-3) + var(--m-safe-top));
}

/* Conteneur responsive */
.m-container {
  width: 100%;
  max-width: var(--m-container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--m-space-4);
  padding-right: var(--m-space-4);
}
@media (min-width: 768px) {
  .m-container {
    padding-left: var(--m-space-6);
    padding-right: var(--m-space-6);
  }
}

/* Visually-hidden (accessibilité) */
.m-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Spinner de chargement par défaut */
.m-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(15,44,82,.15);
  border-top-color: var(--m-bleu-nuit);
  border-radius: 50%;
  animation: m-spin .8s linear infinite;
  display: inline-block;
}
@keyframes m-spin {
  to { transform: rotate(360deg); }
}

/* Skeleton screens */
.m-skeleton {
  background: linear-gradient(
    90deg,
    var(--m-creme-fonce) 0%,
    var(--m-creme) 50%,
    var(--m-creme-fonce) 100%
  );
  background-size: 200% 100%;
  animation: m-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--m-radius-md);
}
@keyframes m-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
