/* Portail SkiGroove : couleurs de l'app (app/lib/ui/theme.dart), comme plans/web. */

:root {
  --ground: #f3f5f7;
  --ground-alt: #e9edf2;
  --card: #ffffff;
  --line: #e2e7ed;
  --ink: #0e1621;
  --muted: #586473;
  --lime: #d4ff3a;
  --on-lime: #0e1621;
  --accent: #1d74d6;
  --hero: #0e1621;
  --hero-ink: #f3f5f7;
  --hero-muted: #9aa6b4;
  --error: #b3261e;
  --error-bg: #fdecea;
  --ok-bg: #eaf7d4;
  --left: #1e88e5;
  --right: #f4511e;
  --shadow: 0 1px 2px rgba(14, 22, 33, 0.08), 0 4px 16px rgba(14, 22, 33, 0.08);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b1118;
    --ground-alt: #101923;
    --card: #16212e;
    --line: #253242;
    --ink: #f3f5f7;
    --muted: #9aa6b4;
    --accent: #4cc4ff;
    --hero: #060b11;
    --error: #ffb4ab;
    --error-bg: #3a1714;
    --ok-bg: #26351a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.9em; }
code { font: 0.92em ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.strong { font-weight: 600; }
.lime { color: var(--lime); }

/* --- Mise en page --- */

.wide { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 32px 16px; }
.narrow-text { max-width: 760px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* --- En-tête et pied --- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.landing .top {
  background: color-mix(in srgb, var(--hero) 92%, transparent);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--hero-ink);
}
.top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { border-radius: 7px; }
.top-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav a:not(.button) { color: inherit; text-decoration: none; font-size: 0.95rem; opacity: 0.85; }
.top-nav a:not(.button):hover, .top-nav a[aria-current="page"] { opacity: 1; text-decoration: underline; }
.top-nav form { margin: 0; }

.foot { border-top: 1px solid var(--line); margin-top: 48px; }
.landing .foot { margin-top: 0; }
.foot-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: inherit; }

/* --- Boutons --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { filter: brightness(1.12); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.button.small { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
.button.lime { background: var(--lime); color: var(--on-lime); }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button.ghost-light { background: transparent; color: var(--hero-ink); border: 1px solid rgba(255, 255, 255, 0.3); }
.button.danger { background: var(--error); color: #fff; }
.landing .top .button { background: var(--lime); color: var(--on-lime); }

/* --- Formulaires --- */

.form { display: grid; gap: 14px; margin: 16px 0; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.form.inline { grid-template-columns: 1fr auto; align-items: end; }
input, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; }
.form-card h1 { font-size: 1.5rem; }
.alert { background: var(--error-bg); color: var(--error); border-radius: 10px; padding: 10px 12px; }
.notice { background: var(--ok-bg); border-radius: 10px; padding: 10px 12px; }

/* --- Accueil --- */

.hero { background: var(--hero); color: var(--hero-ink); overflow: hidden; }
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 16px 64px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); letter-spacing: -0.02em; margin-bottom: 0.4em; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--hero-muted); font-weight: 600; }
.lead { font-size: 1.15rem; color: #cfd6de; max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.status { display: flex; align-items: center; gap: 10px; color: var(--hero-muted); font-size: 0.9rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(212, 255, 58, 0.18); flex: none; }

.hero-art { position: relative; max-width: 360px; justify-self: center; width: 100%; }
.art { display: block; width: 100%; height: auto; }
.art-phone { fill: #1c2836; }
.art-screen { fill: #0b1118; }
.art-contour { fill: none; stroke: #203655; stroke-width: 1.5; }
.art-piste { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 34; stroke-linecap: round; }
.art-trace { fill: none; stroke: url(#sg-speed); stroke-width: 6; stroke-linecap: round; }
.art-start { fill: #4cc4ff; stroke: #0b1118; stroke-width: 3; }
.art-end { fill: #e11d74; stroke: #0b1118; stroke-width: 3; }

.chip {
  position: absolute;
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(22, 33, 46, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--hero-ink);
  backdrop-filter: blur(6px);
}
.chip-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hero-muted); }
.chip-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-value.small { font-size: 1rem; }
.chip-edge { top: 12%; left: -6%; }
.chip-carve { top: 44%; right: -8%; }
.chip-carve .chip-value { color: var(--lime); }
.chip-runs { bottom: 9%; left: -2%; }
.bars { display: grid; gap: 4px; width: 120px; margin-top: 4px; }
.bar { display: block; height: 6px; border-radius: 3px; }
.bar-g { background: var(--left); width: 92%; }
.bar-d { background: var(--right); width: 78%; }
.chip-legend { display: flex; gap: 10px; font-size: 0.72rem; color: var(--hero-muted); }
.key-g::before, .key-d::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.key-g::before { background: var(--left); }
.key-d::before { background: var(--right); }

.band { padding: 64px 0; }
.band.alt { background: var(--ground-alt); }
.section-title { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 28px; letter-spacing: -0.01em; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
  margin-bottom: 12px;
}
.step p, .feature p { color: var(--muted); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.icon {
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 10px;
  background: var(--hero);
  stroke: var(--lime);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 12px;
}
.icon .dash { stroke-dasharray: 2 3; opacity: 0.7; }

.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: start; }
.space-teaser h3 { font-size: 1.2rem; }

.specs { list-style: none; margin: 0; padding: 8px 20px; }
.specs li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs li:last-child { border-bottom: 0; }
.specs li span:first-child { color: var(--muted); }
.specs li span:last-child { text-align: right; font-weight: 600; }

.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.faq p { color: var(--muted); margin: 10px 0 0; }

/* --- Pages légales --- */

.legal { padding-top: 32px; }
.legal h2 { margin-top: 1.6em; }
.legal li { margin-bottom: 0.4em; }
.draft { background: var(--ok-bg); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; }

/* --- Mon espace --- */

.space { display: grid; gap: 16px; padding-top: 28px; }
.space-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.space-head h1 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plain { list-style: none; padding: 0; margin: 0; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows form { margin: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--ground-alt); font-size: 0.8rem; font-weight: 600; }
.card.danger { border-color: color-mix(in srgb, var(--error) 40%, var(--line)); }

/* --- Back-office --- */

.admin main { padding-top: 24px; display: grid; gap: 16px; align-content: start; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { display: grid; text-decoration: none; color: inherit; }
.stat-value { font-size: 2rem; font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; }
.card:has(> .table) { overflow-x: auto; }
.actions form, .inline-confirm { display: flex; gap: 6px; margin: 0; }
.inline-confirm input { min-height: 36px; padding: 4px 10px; min-width: 12rem; }
.mail-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mail-body { white-space: pre-wrap; background: var(--ground); border-radius: 10px; padding: 12px; font-size: 0.9rem; }
.mail.done { opacity: 0.6; }

/* --- Petits écrans --- */

@media (max-width: 860px) {
  .hero-inner, .split { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 36px; }
  .hero-art { max-width: 300px; margin-top: 8px; }
  .chip-edge { left: -4%; }
  .chip-carve { right: -4%; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hide-sm { display: none; }
  .steps, .features { grid-template-columns: 1fr; }
  .band { padding: 44px 0; }
  .form.inline { grid-template-columns: 1fr; }
  .hero-art { max-width: 260px; }
  .chip { padding: 8px 10px; }
  .chip-value { font-size: 1.25rem; }
  .bars { width: 90px; }
}
