/* ============================================================
   HORIZON · design system meteothom (2026)
   Système réutilisable : tokens + composants génériques.
   Aucune dépendance externe (pas de CDN, pas de webfont).
   Le style propre à une page vit dans son fichier dédié
   (ex. home.css) ; ici uniquement le socle partageable.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Teintes pilotables par zone (voir [data-zone] côté page) */
  --hz-bg:        #050a16;
  --hz-bg-soft:   #0a1426;
  --hz-ink:       #e8eef9;
  --hz-ink-soft:  #9fb0c8;
  --hz-ink-faint: #5e6e87;

  --hz-accent:       #46c8ff;
  --hz-accent-deep:  #1f8fd6;
  --hz-accent-warm:  #ffc548;
  --hz-danger:       #ff6b6b;
  --hz-ok:           #4ade80;

  --hz-glass:        rgba(13, 24, 44, .58);
  --hz-glass-strong: rgba(10, 19, 36, .82);
  --hz-line:         rgba(150, 175, 210, .16);
  --hz-line-strong:  rgba(150, 175, 210, .30);

  --hz-radius:    18px;
  --hz-radius-sm: 10px;
  --hz-shadow:    0 18px 50px rgba(2, 6, 16, .55);
  --hz-shadow-sm: 0 6px 18px rgba(2, 6, 16, .35);

  --hz-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hz-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --hz-max: 1180px;

  --hz-ease: cubic-bezier(.22, .8, .3, 1);
  accent-color: var(--hz-accent);
}

[data-theme="light"] {
  --hz-bg:        #eef3fa;
  --hz-bg-soft:   #e2eaf6;
  --hz-ink:       #16233a;
  --hz-ink-soft:  #46587a;
  --hz-ink-faint: #7b8aa6;
  --hz-glass:        rgba(255, 255, 255, .66);
  --hz-glass-strong: rgba(255, 255, 255, .88);
  --hz-line:         rgba(30, 60, 110, .14);
  --hz-line-strong:  rgba(30, 60, 110, .28);
  --hz-shadow:    0 18px 50px rgba(30, 50, 90, .16);
  --hz-shadow-sm: 0 6px 18px rgba(30, 50, 90, .12);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.hz {
  margin: 0;
  background: var(--hz-bg);
  color: var(--hz-ink);
  font-family: var(--hz-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.hz a { color: var(--hz-accent); text-decoration: none; }
.hz a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hz img { max-width: 100%; display: block; }
.hz ::selection { background: var(--hz-accent); color: #04111f; }

.hz-container { width: min(var(--hz-max), calc(100% - 48px)); margin-inline: auto; }
@media (max-width: 640px) { .hz-container { width: calc(100% - 32px); } }

.hz-mono { font-family: var(--hz-mono); font-size: .92em; }
.hz-muted { color: var(--hz-ink-soft); }
.hz-faint { color: var(--hz-ink-faint); }

/* Accessibilité : focus visible homogène */
.hz :focus-visible { outline: 2px solid var(--hz-accent); outline-offset: 2px; border-radius: 4px; }
.hz-skip {
  position: absolute; left: -999px; top: 8px; z-index: 300;
  background: var(--hz-accent); color: #04111f; padding: 8px 14px; border-radius: 8px;
}
.hz-skip:focus { left: 8px; }

/* ---------- Titres ---------- */
.hz h1, .hz h2, .hz h3 { line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .45em; }
.hz-display {
  font-size: clamp(2.6rem, 7.5vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
}
.hz-kicker {
  font-family: var(--hz-mono);
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--hz-accent);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.hz-kicker::before { content: ''; width: 26px; height: 1px; background: var(--hz-accent); opacity: .7; }

/* ---------- Boutons ----------
   Sélecteurs doublés (.hz .hz-btn) : un <a class="hz-btn"> doit garder son
   texte sombre, sans se faire repeindre en accent par la règle « .hz a ». */
.hz .hz-btn,
.hz-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--hz-accent), var(--hz-accent-deep));
  color: #04111f; font-weight: 700; font-size: .95rem;
  cursor: pointer; text-decoration: none !important;
  transition: transform .18s var(--hz-ease), box-shadow .18s var(--hz-ease), filter .18s;
  box-shadow: 0 8px 24px rgba(40, 160, 230, .28);
}
.hz-btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.hz-btn:active { transform: translateY(0); }
.hz .hz-btn.ghost,
.hz-btn.ghost {
  background: transparent; color: var(--hz-ink);
  border-color: var(--hz-line-strong); box-shadow: none;
}
.hz .hz-btn.ghost:hover,
.hz-btn.ghost:hover { border-color: var(--hz-accent); color: var(--hz-accent); }
.hz-btn.small { padding: 7px 14px; font-size: .85rem; }
.hz-btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Cartes / verre ---------- */
.hz-card {
  background: var(--hz-glass);
  border: 1px solid var(--hz-line);
  border-radius: var(--hz-radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--hz-shadow-sm);
  padding: 26px;
}
.hz-card.strong { background: var(--hz-glass-strong); box-shadow: var(--hz-shadow); }

/* ---------- Chips / badges ---------- */
.hz-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--hz-glass); border: 1px solid var(--hz-line);
  font-size: .86rem; color: var(--hz-ink-soft);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hz-chip b { color: var(--hz-ink); font-weight: 700; }
.hz-chip .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--hz-ok);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .6);
  animation: hz-pulse 2.4s infinite;
}
@keyframes hz-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.hz-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  background: rgba(70, 200, 255, .14); color: var(--hz-accent);
  border: 1px solid rgba(70, 200, 255, .25);
}

/* ---------- Étoiles (notation) ---------- */
.hz-stars { display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.hz-stars svg { width: 17px; height: 17px; display: block; }
.hz-stars .st-bg { fill: none; stroke: var(--hz-ink-faint); stroke-width: 1.6; }
.hz-stars .st-fill { fill: var(--hz-accent-warm); stroke: var(--hz-accent-warm); stroke-width: 1.2; }
/* saisie : boutons radio stylés */
.hz-stars-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.hz-stars-input input { position: absolute; opacity: 0; pointer-events: none; }
.hz-stars-input label { cursor: pointer; font-size: 1.7rem; color: var(--hz-ink-faint); transition: color .12s, transform .12s; }
.hz-stars-input label:hover,
.hz-stars-input label:hover ~ label,
.hz-stars-input input:checked ~ label { color: var(--hz-accent-warm); }
.hz-stars-input label:hover { transform: scale(1.15); }
.hz-stars-input input:focus-visible + label { outline: 2px solid var(--hz-accent); border-radius: 4px; }

/* ---------- Formulaires ---------- */
.hz-field { display: grid; gap: 6px; }
.hz-field > span { font-weight: 600; font-size: .92rem; }
.hz-input, .hz-select, .hz-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--hz-radius-sm);
  border: 1px solid var(--hz-line-strong);
  background: var(--hz-bg-soft);
  color: var(--hz-ink);
  font: inherit;
}
.hz-textarea { resize: vertical; min-height: 110px; }
.hz-input:focus, .hz-select:focus, .hz-textarea:focus {
  outline: none; border-color: var(--hz-accent);
  box-shadow: 0 0 0 3px rgba(70, 200, 255, .18);
}
.hz-help { font-size: .82rem; color: var(--hz-ink-faint); }

/* ---------- Dialog / modale ---------- */
dialog.hz-modal {
  border: 1px solid var(--hz-line-strong);
  border-radius: var(--hz-radius);
  background: var(--hz-glass-strong);
  color: var(--hz-ink);
  padding: 28px;
  width: min(560px, calc(100vw - 36px));
  max-height: min(86vh, 760px);
  overflow-y: auto;
  box-shadow: var(--hz-shadow);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
dialog.hz-modal::backdrop { background: rgba(3, 7, 15, .72); backdrop-filter: blur(3px); }
dialog.hz-modal[open] { animation: hz-modal-in .22s var(--hz-ease); }
@keyframes hz-modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.hz-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.hz-modal-head h3 { margin: 0; font-size: 1.25rem; }
.hz-modal-close {
  background: none; border: none; color: var(--hz-ink-soft);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.hz-modal-close:hover { color: var(--hz-ink); }

/* ---------- Toasts ---------- */
.hz-toasts { position: fixed; bottom: 18px; right: 18px; z-index: 400; display: grid; gap: 10px; }
.hz-toast {
  padding: 12px 18px; border-radius: 12px;
  background: var(--hz-glass-strong); border: 1px solid var(--hz-line-strong);
  color: var(--hz-ink); font-size: .92rem; max-width: 340px;
  box-shadow: var(--hz-shadow-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: hz-toast-in .25s var(--hz-ease);
}
.hz-toast.ok { border-color: rgba(74, 222, 128, .5); }
.hz-toast.error { border-color: rgba(255, 107, 107, .55); }
.hz-toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes hz-toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Apparition au scroll ---------- */
.hz-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--hz-ease), transform .7s var(--hz-ease); }
.hz-reveal.in { opacity: 1; transform: none; }
.hz-reveal[data-delay="1"] { transition-delay: .12s; }
.hz-reveal[data-delay="2"] { transition-delay: .24s; }
.hz-reveal[data-delay="3"] { transition-delay: .36s; }
@media (prefers-reduced-motion: reduce) {
  .hz-reveal { opacity: 1; transform: none; transition: none; }
  .hz-chip .dot { animation: none; }
}

/* ---------- Tableau simple ---------- */
.hz-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hz-table th, .hz-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--hz-line); }
.hz-table th { color: var(--hz-ink-faint); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
