:root {
  /* Vert de la marque */
  --green-950: #0b2e22;
  --green-900: #0f3d2e;
  --green-800: #14513c;
  --green-700: #1a6a4e;
  --green-600: #1f8660;
  --green-500: #22a06b;
  --green-300: #8fd4b4;
  --green-100: #dcf3e8;
  --green-50: #f0faf5;

  --bg: #f4f7f5;
  --surface: #ffffff;
  --text: #0f1f18;
  --text-2: #3f5249;
  --muted: #71827a;
  --line: #e2e9e5;
  --line-strong: #cfdad4;
  --amber: #b86e00;
  --amber-bg: #fff3dc;
  --danger: #c2412d;
  --danger-bg: #fdecea;

  --primary: var(--green-700);
  --primary-hover: var(--green-800);
  --soft: var(--green-100);
  --soft-2: var(--green-50);

  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 61, 46, 0.06), 0 12px 32px -12px rgba(15, 61, 46, 0.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page: 720px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1511;
    --surface: #131f1a;
    --text: #e8f2ed;
    --text-2: #b6c7bf;
    --muted: #8a9c94;
    --line: #22332b;
    --line-strong: #2f443a;
    --amber: #f2b150;
    --amber-bg: #3a2a0e;
    --danger: #f08a78;
    --danger-bg: #3a1a15;
    --primary: var(--green-500);
    --primary-hover: #2bb57b;
    --soft: #173a2d;
    --soft-2: #112a21;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

/* L'attribut hidden doit gagner sur les display des composants. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Bandeau vert ---------- */

.band {
  position: relative;
  overflow: hidden;
  padding-bottom: 88px;
  color: #fff;
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(76, 201, 143, 0.35), transparent 60%),
    radial-gradient(600px 300px at -10% 110%, rgba(34, 160, 107, 0.35), transparent 60%),
    linear-gradient(160deg, var(--green-800), var(--green-950));
}
.band::after {
  /* Trame discrète de lignes horaires */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 32px);
  mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent);
  pointer-events: none;
}

.topbar, .hero, .page, .footer {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
}

.topbar-link {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}
.topbar-link:hover { background: rgba(255, 255, 255, 0.12); }

.hero { padding-top: 52px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--green-300);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  word-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.hero-lead {
  max-width: 520px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 600;
}
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { color: var(--green-300); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--green-900);
  font-size: 15px;
  font-weight: 600;
}
.hero-badge svg {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--green-500);
  color: #fff;
  stroke-width: 3;
}

.hero-progress { margin-top: 26px; max-width: 360px; }
.hero-progress-text {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 600;
}
.hero-progress-text strong { color: #fff; font-size: 22px; font-weight: 800; }
.hero-progress .meter { height: 8px; background: rgba(255, 255, 255, 0.16); }
.hero-progress .meter > span { background: var(--green-300); }

.skeleton { border-radius: 10px; background: rgba(255, 255, 255, 0.14); }
.skeleton-title { width: 60%; height: 44px; }
.skeleton-line { width: 40%; height: 18px; margin-top: 18px; }

/* ---------- Contenu ---------- */

.page {
  display: grid;
  gap: 20px;
  margin-top: -56px;
  padding-bottom: 56px;
}

.panel {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-flush { padding: 24px 0 8px; }
.panel-flush > .panel-title, .panel-flush > .panel-head { padding: 0 28px; }

.panel-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.panel-head .panel-title { margin: 0; }
.panel-head .btn-ghost { margin-right: -16px; }

.panel-message { display: grid; gap: 20px; justify-items: start; }
.panel-message p { margin: 0; color: var(--text-2); font-size: 17px; }

.muted { color: var(--muted); }

.footer {
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.footer a { color: inherit; }

/* ---------- Formulaires ---------- */

.form { display: grid; gap: 22px; }

.row { display: grid; gap: 16px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1.4fr 1fr 1fr; }

.field { display: grid; gap: 8px; min-width: 0; }

.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.label svg { width: 15px; height: 15px; color: var(--muted); }

input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 600 16px var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--muted); font-weight: 500; }
input:hover { border-color: var(--muted); }
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--soft);
}
.input-lg { height: 56px; font-size: 18px; }

input[type="date"], input[type="time"] { font-variant-numeric: tabular-nums; }

.stepper {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  height: 50px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stepper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--soft); }
.stepper input {
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  border: 0;
  background: var(--soft-2);
  color: var(--primary);
  font: 700 22px/1 var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.stepper-btn:hover { background: var(--soft); }
.stepper-btn:active { transform: scale(0.94); }

.preview {
  margin: 0 -28px;
  padding: 22px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft-2);
}
.preview-problem { margin: 0; color: var(--amber); font-weight: 600; }

.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.figure { display: grid; gap: 2px; padding-left: 18px; border-left: 1px solid var(--line-strong); }
.figure:first-child { padding-left: 0; border-left: 0; }
.figure strong {
  color: var(--primary);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.figure span { color: var(--text-2); font-size: 13px; font-weight: 600; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chip-more { color: var(--muted); }

.error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font: 700 15px var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.7; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--soft); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 16px -6px rgba(26, 106, 78, 0.55);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary svg { transition: transform 0.15s; }
.btn-primary:hover svg { transform: translateX(2px); }

.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--soft-2); color: var(--primary); }

.btn-choose { background: var(--soft); color: var(--primary); }
.btn-choose:hover { background: var(--primary); color: #fff; }

.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 56px; padding: 0 26px; font-size: 16px; }

.form > .btn { justify-self: start; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark { border-color: var(--line-strong); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.person:hover .icon-btn, .icon-btn:focus-visible { opacity: 1; }
.icon-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- Récents ---------- */

.recent { margin: 0 -12px; padding: 0; list-style: none; }
.recent-row {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.recent-row:hover { background: var(--soft-2); }
.recent-row:hover svg { color: var(--primary); transform: translateX(2px); }
.recent-row svg { color: var(--muted); transition: transform 0.15s; }
.recent-title { font-weight: 700; overflow-wrap: anywhere; }
.recent-date { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- Créneaux ---------- */

.slots, .people { margin: 0; padding: 0; list-style: none; }

.slot {
  padding: 0 28px;
  border-top: 1px solid var(--line);
  transition: background 0.15s;
}

.slot-line {
  display: grid;
  grid-template-columns: 1fr auto 104px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
}
.slot-admin .slot-line { grid-template-columns: 1fr auto; min-height: 72px; }

.slot-when { display: grid; gap: 8px; }

.slot-time {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.slot-sep { color: var(--muted); font-weight: 500; }

.slot-action { justify-self: end; }

.slot:not(.is-full):not(.is-open):hover { background: var(--soft-2); }
.slot.is-full .slot-time { color: var(--muted); font-weight: 600; }
.slot.is-open { background: var(--soft-2); box-shadow: inset 4px 0 0 var(--primary); }
.slot.is-open .slot-time { color: var(--primary); }

.meter {
  display: block;
  width: 100%;
  max-width: 180px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green-500);
  transition: width 0.3s;
}
.is-full .meter > span, .is-complete .meter > span { background: var(--muted); }

.badge {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-last { background: var(--amber-bg); color: var(--amber); }
.badge-full { background: var(--line); color: var(--muted); }

.slot-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px 14px;
  padding-bottom: 24px;
}
.slot-form .error { grid-column: 1 / -1; }

.count {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.count span { color: var(--muted); font-size: 15px; font-weight: 600; }
.is-complete .count { color: var(--text); }

.people { display: grid; gap: 4px; padding-bottom: 18px; }
.person {
  display: grid;
  grid-template-columns: 34px 1fr 32px;
  align-items: center;
  gap: 12px;
  margin-right: -8px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.person-name { font-weight: 600; overflow-wrap: anywhere; }
.people-empty {
  margin: -6px 0 0;
  padding-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Partage ---------- */

.share { display: grid; gap: 8px; }
.share + .share { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.share-private .label { color: var(--text-2); }
.share-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.share-input {
  height: 48px;
  background: var(--soft-2);
  border-color: var(--line);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}
.share-private .share-input { background: var(--surface); color: var(--muted); }

/* ---------- Confirmation ---------- */

.panel-done {
  display: grid;
  justify-items: center;
  padding: 40px 28px;
  text-align: center;
}
.done-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--green-500);
  color: #fff;
  box-shadow: 0 0 0 10px var(--soft);
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.done-icon svg { width: 30px; height: 30px; stroke-width: 3; }
.done-label { margin: 0; color: var(--text-2); font-weight: 700; }
.done-time {
  margin: 4px 0;
  color: var(--primary);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.done-date { margin: 0 0 26px; color: var(--muted); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: var(--green-900);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(11, 46, 34, 0.35);
  transform: translateX(-50%);
  animation: rise 0.25s ease-out;
}
.toast svg { color: var(--green-300); stroke-width: 3; }
.toast.is-error { background: var(--danger); }
@keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .topbar, .hero, .page, .footer { padding-left: 16px; padding-right: 16px; }
  .band { padding-bottom: 76px; }
  .hero { padding-top: 36px; }
  .hero-lead { font-size: 16px; }
  .page { gap: 16px; margin-top: -52px; }
  .panel { padding: 22px 18px; border-radius: 18px; }
  .panel-flush { padding: 20px 0 4px; }
  .panel-flush > .panel-title, .panel-flush > .panel-head { padding: 0 18px; }
  .preview { margin: 0 -18px; padding: 18px; }
  .row-3 { grid-template-columns: 1fr 1fr; }
  .row-3 > :first-child { grid-column: 1 / -1; }
  .row-2 { grid-template-columns: 1fr; }
  .figure strong { font-size: 22px; }
  .figure { padding-left: 12px; }
  .form > .btn { justify-self: stretch; }
  .slot { padding: 0 18px; }
  .slot-line {
    grid-template-columns: 1fr auto;
    grid-template-areas: "when action" "badge action";
    gap: 10px 12px;
    padding: 16px 0;
    min-height: 0;
  }
  .slot-line .slot-when { grid-area: when; }
  .slot-line .badge { grid-area: badge; justify-self: start; }
  .slot-line .slot-action { grid-area: action; }
  .slot-admin .slot-line { padding: 16px 0; }
  .slot-time { font-size: 18px; }
  .slot-form { grid-template-columns: 1fr; }
  .slot-form .btn { width: 100%; }
  .share-field { grid-template-columns: 1fr; }
  .share-field .btn { width: 100%; }
  .done-time { font-size: 34px; }
}
