/* Speed Reservations — système de thème / teinte (variables CSS configurables) */
:root {
  --primary: #20B2AA;
  --primary-dark: #17877f;
  --accent: #15a36e;
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1d212b;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --border: #262b36;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  /* Échelle d'espacement unique (utilisée partout) */
  --sp-1: 6px; --sp-2: 10px; --sp-3: 14px; --sp-4: 18px; --sp-5: 24px; --sp-6: 32px;
  --gap: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;   /* pas de flash gris au tap */
  overscroll-behavior-y: none;                 /* pas de rebond façon site */
}
/* Empêche le zoom automatique iOS au focus des champs (déclenché si < 16px) */
input, select, textarea { font-size: 16px; }
/* Mode application : pas de sélection de texte sur l'interface (sauf contenus utiles) */
.nav, .side, .tabbar, .access-bar, .cat-head, .btn, .chip, .dev-btn, button { -webkit-user-select: none; user-select: none; }
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; border: 0;
  padding: 12px 20px; border-radius: 999px; font-weight: 600;
  cursor: pointer; font-size: 15px; transition: transform .08s, background .2s;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
/* Boutons secondaires VISIBLES : contour bleu net (jamais la couleur du fond) + survol rempli bleu/texte blanc. */
.btn.ghost { background: var(--surface-2); border: 1px solid var(--primary); color: var(--text); }
.btn.ghost:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); }
.btn.block { width: 100%; justify-content: center; }
.btn.sm { padding: 8px 14px; font-size: 13px; }

/* Cartes */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.tag.on { color: var(--accent); border-color: var(--accent); }
.tag.off { color: var(--muted); }

/* Header */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(15,17,21,.85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand .logo { font-size: 22px; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 700px) { .nav-links { display: none; } }

/* Bouton aide "?" */
.help {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 6px;
}
.help:hover { color: var(--text); border-color: var(--primary); background: var(--primary); }
.upload-btn { display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border:1px dashed var(--border); border-radius:12px; background: var(--surface-2); color: var(--text); cursor:pointer; font-size:14px; font-weight:600; transition:.15s; }
.upload-btn:hover { border-color: var(--primary); border-style:solid; }
/* Rubriques repliables (accordéon) — partout pareil (.card, .box) */
.foldable > :first-child { cursor:pointer; -webkit-user-select:none; user-select:none; }
.foldable > :first-child::after { content:'▾'; float:right; color: var(--muted); font-weight:400; margin-left:8px; }
.foldable.collapsed > :first-child::after { content:'▸'; }
.foldable.collapsed > :not(:first-child) { display:none !important; }
.foldable > :first-child:hover { color: var(--primary); }
/* Titre suivi d'une carte (titre EN DEHORS de la carte) */
.foldhead { cursor:pointer; -webkit-user-select:none; user-select:none; }
.foldhead::after { content:'▾'; float:right; color: var(--muted); font-weight:400; margin-left:8px; }
.foldhead.collapsed::after { content:'▸'; }
.foldhead:hover { color: var(--primary); }
.foldhead.collapsed + .card, .foldhead.collapsed + .box { display:none !important; }
/* Grille des concepts : colonnes régulières, lignes pleines, pas de trous */
.concept-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.concept-grid > .card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; text-align:center; min-height:96px; }
@media(max-width:760px){ .concept-grid { grid-template-columns:repeat(2,1fr); } }

h1, h2, h3 { line-height: 1.2; }
.section { padding: 64px 0; }
.center { text-align: center; }

/* Cartes Tarifs — boutons alignés en bas quelle que soit la hauteur du contenu */
.plan-card { display: flex; flex-direction: column; height: 100%; }
.plan-badge { min-height: 26px; }
.plan-features { padding-left: 18px; color: var(--muted); margin: 16px 0; flex: 1 1 auto; }
.plan-card .btn.block { margin-top: auto; }

/* Cartes Boutique — description extensible, prix + « Compatible » + bouton alignés en bas */
.shop-card { display: flex; flex-direction: column; height: 100%; }
.shop-desc { font-size: 14px; flex: 1 1 auto; }
.shop-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; min-height: 28px; }
.shop-add { margin-top: 12px; }

/* ===== UTILITAIRES DE NORMALISATION (mêmes règles dans tous les espaces) ===== */
.grid > .card { height: 100%; }                         /* cartes d'une même rangée = même hauteur */
.card--action { display: flex; flex-direction: column; }/* carte avec bouton aligné en bas */
.card--action > .grow { flex: 1 1 auto; }
.card--action > .btn:last-child, .card--action > .actions:last-child { margin-top: auto; }
.actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--sp-3); }
.mt-2 { margin-top: var(--sp-3); } .mt-3 { margin-top: var(--sp-5); }
h3 { margin: 0 0 var(--sp-2); } h4 { margin: var(--sp-4) 0 var(--sp-2); }
/* Champs de formulaire homogènes partout */
input.fld, select.fld, textarea.fld, .fld { border-radius: var(--radius-sm); }
/* Boutons : tailles cohérentes */
.btn { line-height: 1.1; }
.btn.sm { padding: 8px 14px; font-size: 13px; }

/* Bouton appareil photo — visible et tactile (capture rapide) */
.cam-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; border-radius: 14px; cursor: pointer;
  border: 2px dashed var(--primary); background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 15px; transition: background .2s, transform .08s;
}
.cam-btn:active { transform: scale(.98); background: var(--surface); }
.cam-btn.done { border-style: solid; border-color: var(--accent); color: var(--accent); }
.cam-btn .cam-ic { font-size: 24px; }
.cam-btn input { display: none; }
.cam-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cam-req { color: #e0683c; font-weight: 600; }

/* ===== ACCESSIBILITÉ (Design System Phase 4) ===== */
/* Focus CLAVIER visible partout (WCAG 2.4.7). :focus-visible → ne s'affiche qu'au clavier, jamais à la souris
   (aucun changement de rendu pour la souris). Contour teal net sur le fond sombre. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}
/* Navigateurs qui SUPPORTENT :focus-visible : on retire l'outline de focus SOURIS (pas clavier). Les vieux
   navigateurs gardent l'outline natif → jamais un utilisateur clavier sans repère. */
@supports selector(:focus-visible) {
  a:focus:not(:focus-visible),
  button:focus:not(:focus-visible),
  input:focus:not(:focus-visible),
  select:focus:not(:focus-visible),
  textarea:focus:not(:focus-visible),
  [tabindex]:focus:not(:focus-visible) { outline: none; }
}
/* Respect de « mouvement réduit » (WCAG 2.3.3) : neutralise animations/transitions pour qui le demande. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
