@import url('/vendor/fonts/manrope/index.css');

/* Identité Mad & Moselle : les couleurs viennent du logo.
   Bleu du « M » (#2D87C9), rouge du « M » (#A02124), bordeaux de leur croisement (#542629) pour les textes,
   jaune de l'esperluette (#E3CF1D) en touche. Fonds blancs légèrement chauds, une seule famille (Manrope). */
:root {
  --bg: #f6f4f4;
  --surface: #ffffff;
  --surface-2: #f3eff0;
  --ink: #2b1d21;
  --ink-2: #57454b;
  --muted: #7d6c72;
  --line: #ebe4e6;
  --line-strong: #d8cdd0;
  --brand-blue: #2d87c9;
  --brand-red: #a02124;
  --brand-wine: #542629;
  --brand-yellow: #e3cf1d;
  --primary: #2277b8;
  --primary-hover: #1b6299;
  --primary-ink: #ffffff;
  --primary-soft: #e6f1fa;
  --accent: #a02124;
  --accent-soft: #f8e7e8;
  --good: #1d7a4f;
  --good-soft: #e3f4ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --shadow-sm: 0 1px 2px rgb(84 38 41 / .07);
  --shadow: 0 1px 2px rgb(84 38 41 / .06), 0 12px 32px -16px rgb(84 38 41 / .22);
  --brand-stripe: linear-gradient(90deg, var(--brand-blue) 0 46%, var(--brand-red) 46% 92%, var(--brand-yellow) 92%);
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --font: 'Manrope Variable', 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-md: .9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.875rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #150f11;
    --surface: #1f171a;
    --surface-2: #2a1f23;
    --ink: #f4eef0;
    --ink-2: #d2c4c9;
    --muted: #a3929a;
    --line: #3a2b30;
    --line-strong: #4d3a40;
    --brand-blue: #5aa6e0;
    --brand-red: #e0585c;
    --brand-wine: #b9787b;
    --brand-yellow: #ecd94a;
    --primary: #5aa6e0;
    --primary-hover: #7fbae8;
    --primary-ink: #150f11;
    --primary-soft: #1d2d3d;
    --accent: #e8777a;
    --accent-soft: #3a1c1f;
    --good: #5fc796;
    --good-soft: #13301f;
    --warn: #e8ad55;
    --warn-soft: #36270f;
    --bad: #f28b82;
    --bad-soft: #3a1714;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 36px -18px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #150f11;
  --surface: #1f171a;
  --surface-2: #2a1f23;
  --ink: #f4eef0;
  --ink-2: #d2c4c9;
  --muted: #a3929a;
  --line: #3a2b30;
  --line-strong: #4d3a40;
  --brand-blue: #5aa6e0;
  --brand-red: #e0585c;
  --brand-wine: #b9787b;
  --brand-yellow: #ecd94a;
  --primary: #5aa6e0;
  --primary-hover: #7fbae8;
  --primary-ink: #150f11;
  --primary-soft: #1d2d3d;
  --accent: #e8777a;
  --accent-soft: #3a1c1f;
  --good: #5fc796;
  --good-soft: #13301f;
  --warn: #e8ad55;
  --warn-soft: #36270f;
  --bad: #f28b82;
  --bad-soft: #3a1714;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 36px -18px rgb(0 0 0 / .7);
  color-scheme: dark;
}

/* Bandeau tricolore du logo (bleu · rouge · jaune) en signature en haut des cartes principales */
.brand-top { position: relative; }
.brand-top::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--brand-stripe); border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; z-index: 1; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 var(--fs-md)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3, h4 { font-weight: 750; letter-spacing: -.02em; line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

/* Logo d'origine, toujours posé sur blanc */
.logo-tile { display: inline-grid; place-items: center; background: #ffffff; border-radius: 14px; padding: 6px; box-shadow: var(--shadow-sm); }
.logo-tile img { display: block; width: 100%; height: auto; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 700 var(--fs-md)/1 var(--font);
  padding: .85em 1.3em; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: transparent; }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { font-size: var(--fs-sm); padding: .6em 1em; }
.btn-block { width: 100%; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Champs */
.field { display: grid; gap: .4rem; min-width: 0; }
.field > span, .field > label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.field small { color: var(--muted); font-size: var(--fs-xs); }
.req { color: var(--brand-red); margin-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; font: 500 var(--fs-md)/1.4 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .78em .9em; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover { border-color: var(--ink-2); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
textarea.input { resize: vertical; min-height: 4.5em; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; line-height: 1.5; }
.check input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--primary); flex: none; cursor: pointer; }

.pill { display: inline-flex; align-items: center; gap: .4em; font-size: var(--fs-xs); font-weight: 700; padding: .3em .7em; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--primary-soft); color: var(--primary); }
.pill-mute { background: var(--surface-2); color: var(--muted); }

.notice { padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.notice-bad { background: var(--bad-soft); color: var(--bad); }
.notice-good { background: var(--good-soft); color: var(--good); }
.notice-info { background: var(--primary-soft); color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Logo Okréno (écrans de connexion) */
.brand-logo { display: block; width: 200px; max-width: 70%; height: auto; }

/* Bandeau d'information défilant (mode canicule) : module public et appli agent */
.ticker {
  --ticker-bg: #fff1d6; --ticker-ink: #7a3d00; --ticker-accent: #e0791c;
  display: flex; align-items: stretch; overflow: hidden; border-radius: 12px; background: var(--ticker-bg); color: var(--ticker-ink);
  border: 1px solid color-mix(in srgb, var(--ticker-accent) 45%, transparent); font-weight: 700; font-size: var(--fs-sm);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ticker { --ticker-bg: #3a2410; --ticker-ink: #ffd8a6; --ticker-accent: #ff9a3c; } }
:root[data-theme="dark"] .ticker { --ticker-bg: #3a2410; --ticker-ink: #ffd8a6; --ticker-accent: #ff9a3c; }
.ticker-tag { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--ticker-accent); color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: var(--fs-xs); }
.ticker-view { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: inline-flex; gap: 64px; padding-left: 24px; white-space: nowrap; animation: ticker var(--ticker-dur, 22s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 32px)); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; white-space: normal; padding: 8px 12px; }
  .ticker-track > :not(:first-child) { display: none; }
}
