/* Jetons de design Schengen Radar — partagés avec l'app iOS (ios/Sources/Theme.swift).
   Sombre par défaut ; [data-theme="light"] bascule en clair. */

:root {
  --bg: #0b1120;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #eef2ff;
  --ink-soft: #c3cad9;
  --muted: #8b93a7;
  --accent: #34d399; /* vert disponibilité */
  --accent-soft: rgba(52, 211, 153, 0.12);
  --on-accent: #06241a;
  --blue: #60a5fa;
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.1);
  --header-bg: rgba(11, 17, 32, 0.65);
  --dialog-bg: #111a2e;
  --backdrop: rgba(4, 8, 18, 0.7);
  --card-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  --mesh-a: rgba(52, 211, 153, 0.16);
  --mesh-b: rgba(56, 130, 246, 0.14);
  --mesh-c: rgba(167, 139, 250, 0.1);
  --radius: 16px;
  font-size: 16px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --line: rgba(16, 24, 40, 0.08);
  --line-strong: rgba(16, 24, 40, 0.18);
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #5b6478;
  --accent: #0d9466;
  --accent-soft: rgba(13, 148, 102, 0.1);
  --on-accent: #ffffff;
  --blue: #2563eb;
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.1);
  --header-bg: rgba(246, 248, 251, 0.75);
  --dialog-bg: #ffffff;
  --backdrop: rgba(15, 23, 42, 0.35);
  --card-shadow: 0 4px 18px rgba(16, 24, 40, 0.07);
  --mesh-a: rgba(13, 148, 102, 0.1);
  --mesh-b: rgba(37, 99, 235, 0.08);
  --mesh-c: rgba(124, 58, 237, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ─── Fond décoratif ─────────────────────────────────────────────── */

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42rem 28rem at 12% -8%, var(--mesh-a), transparent 60%),
    radial-gradient(38rem 26rem at 95% 4%, var(--mesh-b), transparent 60%),
    radial-gradient(50rem 36rem at 50% 115%, var(--mesh-c), transparent 65%);
}

/* ─── En-tête ────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.6rem; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  color: #06241a;
  background: linear-gradient(135deg, #34d399, #6ee7b7);
  box-shadow: 0 4px 18px rgba(52, 211, 153, 0.35);
}

.brand-mark svg { width: 1.2rem; height: 1.2rem; }

.brand-name {
  font-family: "Sora", "Inter", sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 0.6rem; }

.lang-toggle, .theme-toggle {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.theme-toggle { padding: 0.32rem 0.6rem; line-height: 1; }

.lang-toggle:hover, .theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

.live-pill.offline { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

.live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ─── Contenu ────────────────────────────────────────────────────── */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.hero { max-width: 44rem; margin-bottom: 2.25rem; }

.hero h1 {
  font-family: "Sora", "Inter", sans-serif;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.75rem;
}

.gradient-text {
  background: linear-gradient(95deg, var(--accent), var(--blue) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 1rem; }

.honest {
  color: var(--muted);
  font-size: 0.85rem;
  border-left: 3px solid var(--line-strong);
  padding-left: 0.75rem;
  margin: 0;
}

/* ─── Sélecteur de centres ───────────────────────────────────────── */

.centres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.centres button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.centres button:hover { color: var(--ink); border-color: var(--line-strong); }

.centres button[aria-pressed="true"] {
  color: var(--on-accent);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
  border-color: transparent;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ─── Grille des destinations ────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.9rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: var(--card-shadow);
  animation: rise 0.35s ease both;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top { display: flex; align-items: center; gap: 0.65rem; }

.flag { font-size: 1.6rem; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25)); }

.dest-name {
  font-family: "Sora", "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.dest-en { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 400; }

/* Date = lien direct vers la prise de RDV VFS */
.date-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.98rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  transition: all 0.18s ease;
}

.date-link .arrow { transition: transform 0.18s ease; }

.date-link:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 18%, transparent);
}

.date-link:hover .arrow { transform: translateX(3px); }

.date-hint { display: block; font-size: 0.68rem; font-weight: 500; color: color-mix(in srgb, var(--accent) 75%, var(--muted)); }

.date-none {
  color: var(--muted);
  font-size: 0.92rem;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.checked { color: var(--muted); font-size: 0.74rem; }

.btn-alert {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-alert:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ─── Squelettes de chargement ───────────────────────────────────── */

.skeleton {
  pointer-events: none;
  min-height: 9rem;
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-strong) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.status { color: var(--muted); }
.status.error { color: var(--warn); }

/* ─── Dialogue Passe Alerte ──────────────────────────────────────── */

dialog {
  background: var(--dialog-bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  max-width: 26rem;
  width: calc(100vw - 2rem);
  padding: 1.5rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(4px);
}

.dialog-head { display: flex; align-items: center; gap: 0.6rem; }
.dialog-icon { font-size: 1.4rem; }

dialog h2 {
  margin: 0;
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.route-label { color: var(--ink-soft); font-weight: 600; margin: 0.75rem 0 0.5rem; }

dialog label { display: block; margin: 1.1rem 0; font-weight: 600; font-size: 0.92rem; }

dialog input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

dialog input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.25rem; }

.btn-ghost, .btn-primary {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover { color: var(--ink); }

.btn-primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
  border: none;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}

.btn-primary:hover { filter: brightness(1.08); }

.fineprint { color: var(--muted); font-size: 0.75rem; margin: 1rem 0 0; }

/* ─── Pied de page ───────────────────────────────────────────────── */

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

/* Header serré sur petit écran : la pastille live garde juste son point. */
@media (max-width: 430px) {
  #live-pill-text { display: none; }
  .live-pill { padding: 0.3rem 0.45rem; }
  .header-right { gap: 0.45rem; }
}

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