:root {
  --red: #b3261e;
  --red-dark: #8c1d17;
  --green: #1e6b3a;
  --green-light: #e4f1e8;
  --orange: #d9650a;
  --orange-light: #fdefe1;
  --text: #1f1f1f;
  --muted: #5f6368;
  --background: #faf6ef;
  --card: #ffffff;
  --border: #e6ddd0;
  --error-background: #fbe9e7;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

main.wide { max-width: 1100px; }

h1 { font-size: 1.6rem; margin: 8px 0; color: var(--red-dark); }
h2 { font-size: 1.2rem; margin: 0 0 6px; }
h3 { font-size: 1.05rem; margin: 0 0 4px; }
p { margin: 6px 0; }
a { color: var(--green); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--red);
  color: #fff;
  border-bottom: 4px solid var(--green);
}
.site-header a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.05rem; }
.header-link { font-size: 0.95rem; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; white-space: nowrap; }
.header-links { display: flex; gap: 8px; flex-wrap: wrap; }

.intro { margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
}
.card--highlight { border: 2px solid var(--green); background: var(--green-light); }
.card--past { opacity: 0.65; }

fieldset.card { display: block; min-width: 0; }
legend { font-weight: 700; padding: 0 4px; }

.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--orange-light);
  border: 1px solid var(--orange);
}
.notice--success { background: var(--green-light); border-color: var(--green); }
.notice--error { background: var(--error-background); border-color: var(--red); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}
.badge--confirmed { background: var(--green); color: #fff; }
.badge--waitlisted { background: var(--orange); color: #fff; }
.badge--muted { background: #e8e8e8; color: var(--muted); }
.badge--closed { background: var(--red); color: #fff; }

label { display: block; margin: 10px 0; font-weight: 600; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=time], textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 11px 12px;
  font-size: 1rem;
  border: 1px solid #c9c1b4;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
}
input:focus, textarea:focus { outline: 3px solid var(--orange-light); border-color: var(--orange); }
.privacy-note { font-size: 0.85rem; color: var(--muted); }

.button {
  display: inline-block;
  padding: 11px 18px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.button:hover { filter: brightness(1.1); }
.button--secondary { background: #fff; color: var(--green); border: 2px solid var(--green); }
.button--waitlist { background: var(--orange); }
.button--danger { background: var(--red); }
.button--small { padding: 6px 12px; font-size: 0.9rem; }
.button--link { background: none; color: var(--red); padding: 6px 0; text-decoration: underline; font-weight: 600; }

.step-title { margin-top: 20px; }

.slot-list { list-style: none; padding: 0; margin: 0; }
.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
}
.slot-row--next { border: 2px solid var(--green); }
.slot-time { display: block; font-size: 1.15rem; font-weight: 700; }
.slot-places { display: block; color: var(--muted); font-size: 0.95rem; }
.next-label { display: block; color: var(--green); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.countdown { font-size: 1.3rem; font-weight: 700; color: var(--red-dark); }

.slot-chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: 8px; background: var(--green-light); color: var(--green); font-weight: 700; }
.slot-chip small { font-weight: 500; font-size: 0.75rem; }
.slot-chip--full { background: #eee; color: var(--muted); }

/* Animateur et admin */
.attendee-list { list-style: none; padding: 0; margin: 8px 0; }
.attendee-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.attendee-row:last-child { border-bottom: none; }
.attendee-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.attendee-row--present .attendee-name { color: var(--green); font-weight: 700; }
.presence-toggle {
  width: 40px; height: 40px; flex: none;
  border-radius: 8px; border: 2px solid var(--green);
  background: #fff; font-size: 1.2rem; cursor: pointer;
}
.presence-toggle--checked { background: var(--green); color: #fff; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label { flex: 1 1 140px; margin: 4px 0; }
.inline-form input { margin-top: 2px; }

details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.summary-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.fill-bar { height: 8px; border-radius: 4px; background: #eee; min-width: 60px; overflow: hidden; }
.fill-bar > span { display: block; height: 100%; background: var(--green); }
.fill-bar--full > span { background: var(--red); }

.link-box { display: block; padding: 8px; background: #f3efe8; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 0.85rem; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
