:root {
  --ink: #0b0b0f;
  --blue: #00abf3;
  --pink: #fe2b54;
  --bg: #fafafa;
  --card: #fff;
  --line: #e7e7ea;
  --muted: #6b6f76;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.05s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: #2b2b33; border-color: #2b2b33; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #c9cbd1; background: #f4f4f5; }
.btn.danger { background: transparent; color: var(--pink); border-color: transparent; }
.btn.danger:hover { background: #fff0f3; }
.btn.sm { padding: 6px 12px; font-size: 0.85rem; }
.btn.block { width: 100%; padding: 13px 18px; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
label .muted { font-weight: 400; }
input, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d9dbe0; border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, .btn:focus-visible, .slot:focus-visible {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 171, 243, 0.2);
}
input.invalid { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(254, 43, 84, 0.15); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.error {
  background: #fff0f3; color: #c4143a; border: 1px solid #ffc9d4; border-radius: 10px;
  padding: 10px 13px; font-size: 0.9rem; font-weight: 600; margin: 10px 0;
}

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

/* Autocomplétion du lieu */
.autocomplete { position: relative; }
.suggest {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}
.suggest:empty { display: none; }
.suggest button {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 0.9rem; text-align: left; color: var(--ink); cursor: pointer;
}
.suggest button:hover, .suggest button:focus { background: #f4f4f5; outline: none; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  background: #e6f7fe; color: #0079ad;
}
.badge.closed { background: #fff0f3; color: #c4143a; }

/* ---------- Interface organisateur ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: none; position: sticky; top: 0; height: 100vh; padding: 22px 12px 14px;
  background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.sidebar .brand { display: block; padding: 0 8px 22px; }
.sidebar .brand img { height: 30px; display: block; }
.sidebar nav { flex: 1; }
.nav-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 18px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 0.95rem;
}
.nav-item svg { flex: none; }
.nav-item:hover, .nav-item.active { background: #f1f1f3; }
.sidebar .user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; background: #8a2d3b; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
}
.sidebar .who { flex: 1; min-width: 0; font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: none; padding: 7px; border-radius: 8px; color: var(--muted); cursor: pointer; display: flex; }
.icon-btn:hover { background: #f1f1f3; color: var(--ink); }

.container { flex: 1; min-width: 0; max-width: 1040px; margin: 0 auto; padding: 40px 32px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.back:hover { color: var(--ink); }

.auth-page {
  min-height: 100vh; max-width: 1040px; margin: 0 auto; padding: 48px 24px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center;
}
.auth-intro .logo { display: block; height: 40px; margin-bottom: 36px; }
.auth-intro .eyebrow { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink); margin-bottom: 10px; }
.auth-intro h2 { font-size: 2rem; font-weight: 700; line-height: 1.2; margin-bottom: 14px; }
.auth-intro > .muted { font-size: 1.05rem; margin-bottom: 28px; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.features li { display: flex; gap: 12px; align-items: flex-start; }
.features svg { flex: none; padding: 7px; width: 34px; height: 34px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--blue); }
.features li:nth-child(even) svg { color: var(--pink); }
.features span { padding-top: 5px; }
.auth { width: 100%; max-width: 400px; justify-self: end; }
.auth h1 { font-size: 1.4rem; margin-bottom: 20px; text-align: center; }
.auth .switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--muted); }
.auth .switch a { font-weight: 700; cursor: pointer; }

.form-list { display: grid; gap: 14px; }
.form-card { display: flex; gap: 16px; align-items: flex-start; }
.form-card .thumb {
  width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain;
  background: #fff; flex: none;
}
.form-card .thumb.placeholder { background: linear-gradient(135deg, var(--blue) 50%, var(--pink) 50%); border: 0; }
.form-card .info { flex: 1; min-width: 0; }
.form-card h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.form-card .stats { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); margin: 6px 0 14px; }
.form-card .stats b { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; padding: 56px 24px; }
.empty h2 { margin-bottom: 8px; }
.empty p { margin-bottom: 20px; }

/* Éditeur */
.section { margin-bottom: 20px; }
.section > h2 { margin-bottom: 16px; }
.logo-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-field img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.day { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.day-head { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.day-head .field { flex: 1; max-width: 240px; margin: 0; }
.slot-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.slot-row label { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.slot-row .remove { padding: 9px 12px; }
.footer-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Participants */
.slot-group { margin-bottom: 18px; padding: 0; overflow: hidden; }
.slot-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.meter { width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--blue); }
.meter.full i { background: var(--pink); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.none { padding: 14px 20px; color: var(--muted); font-size: 0.9rem; }

/* Fenêtre de partage */
.overlay { position: fixed; inset: 0; background: rgba(11, 11, 15, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.modal { width: 100%; max-width: 420px; text-align: center; }
.modal h2 { margin-bottom: 4px; }
.modal img.qr { width: 220px; height: 220px; margin: 16px auto; display: block; border: 1px solid var(--line); border-radius: 12px; }
.copy-row { display: flex; gap: 8px; margin-top: 16px; }
.copy-row input { flex: 1; font-size: 0.85rem; }
.modal .actions { justify-content: center; margin-bottom: 8px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
}

/* ---------- Formulaire public ---------- */
.public { max-width: 620px; margin: 0 auto; padding: 40px 20px 80px; }
.public-head { text-align: center; margin-bottom: 28px; }
.public-logo { max-width: 160px; max-height: 110px; object-fit: contain; margin-bottom: 18px; }
.public-head h1 { font-size: 2rem; }
.public-desc { color: var(--muted); margin-top: 10px; white-space: pre-line; }
.public-loc { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 0.95rem; }
.public-loc svg { flex: none; color: var(--pink); }
.public-loc a { color: var(--ink); font-weight: 600; }
.deadline-note { text-align: center; font-size: 0.875rem; color: var(--muted); margin-bottom: 18px; }
.public .card { margin-bottom: 16px; }
.step { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue); margin-bottom: 4px; }
.date-title { font-weight: 800; text-transform: capitalize; margin: 18px 0 10px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot {
  padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.slot b { display: block; font-size: 1rem; }
.slot span { font-size: 0.8rem; color: var(--muted); }
.slot:hover:not(:disabled) { border-color: var(--ink); }
.slot.selected { border-color: var(--blue); background: #e6f7fe; }
.slot.selected span { color: #0079ad; }
.slot:disabled { background: #eef0f3; color: #9aa1ad; cursor: not-allowed; }
.slot:disabled span { color: #9aa1ad; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.recap { background: #e6f7fe; color: #005f88; border-radius: 10px; padding: 10px 13px; font-weight: 600; font-size: 0.9rem; margin: 12px 0 18px; }
.confirm-message { margin-top: 8px; white-space: pre-line; }
.cal-title { font-weight: 800; margin: 20px 0 10px; }
.cal-list { text-align: left; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; }
.cal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 0.9rem; }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-row b { text-transform: capitalize; }
.slot { position: relative; }
.slot .tick {
  position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #c9cbd1;
  display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 0.75rem; font-weight: 700; color: #fff;
}
.slot.selected .tick { background: var(--blue); border-color: var(--blue); }
.options { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.options-title { font-weight: 600; margin-bottom: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 0.95rem; margin-bottom: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: none; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}

@media (max-width: 600px) {
  .form-card { flex-direction: column; }
  .slot-row { grid-template-columns: 1fr 1fr; }
  th, td { padding: 10px 12px; }
}

@media (max-width: 820px) {
  .auth-page { grid-template-columns: 1fr; gap: 32px; padding: 32px 16px; min-height: 0; }
  .auth-intro h2 { font-size: 1.5rem; }
  .auth { justify-self: stretch; max-width: none; }
  .layout { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 6px 0 0; }
  .sidebar .brand img { height: 24px; }
  .sidebar nav { display: flex; gap: 4px; }
  .nav-label, .nav-item span, .sidebar .who { display: none; }
  .sidebar .user { border: 0; padding: 0; }
  .container { padding: 24px 16px 60px; width: 100%; }
}
