/* Layout : carte-invitation (en-tête nuit étoilée) + formulaire ; admin = chiffres en haut, liste dessous */
:root {
  --bg: #eef1f6; --card: #ffffff; --ink: #172038; --muted: #5b6480; --line: #dde2ec;
  --night: #14204a; --night-2: #24336b; --gold: #b88a2e; --gold-soft: #f5ecd8;
  --err: #b3261e; --err-soft: #fbe9e7;
  --display: 'Frank Ruhl Libre', Georgia, 'Times New Roman', serif;
  --body: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1124; --card: #151c35; --ink: #e8ebf5; --muted: #a2aac4; --line: #2a3354;
    --night: #0a0f22; --night-2: #2b3b7a; --gold: #d9ae55; --gold-soft: #2c2716;
    --err: #f08b84; --err-soft: #3a1d1c; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body);
  padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.wrap { max-width: 520px; margin: 0 auto; display: grid; gap: 18px; }
.wrap.wide { max-width: 880px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pad { padding: 22px; }
h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }
h2 { font-size: 24px; }
.muted { color: var(--muted); margin: 0; }

/* ---------- Page invités ---------- */
.hero {
  background:
    radial-gradient(1.5px 1.5px at 18% 30%, #ffffff88 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 22%, #ffffff99 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 85% 60%, #ffffff66 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 70%, #ffffff55 50%, transparent 51%),
    linear-gradient(160deg, var(--night-2), var(--night));
  color: #fff; padding: 28px 24px 26px; text-align: center;
}
.hero-top { display: flex; justify-content: space-between; font-size: 13px; opacity: .8; margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: #e9c77e; margin: 0 0 8px; font-weight: 600; }
.hero h1 { font-size: clamp(28px, 7vw, 36px); line-height: 1.15; }
.sub { margin: 10px 0 0; opacity: .85; font-size: 15px; }

.details { padding: 6px 22px; }
.row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.lbl { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.val { font-weight: 500; min-width: 0; }
.val small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 13px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.chip:hover { border-color: var(--gold); }

.form { padding: 24px 22px 26px; display: grid; gap: 16px; }
.hint { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
input[type=text], input[type=password], input[type=search] {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; width: 100%; min-width: 0;
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.counter { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.counter .name { font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.stepper button:focus-visible { outline: 2px solid var(--gold); }
.stepper input {
  width: 44px; text-align: center; font: 600 18px var(--body); color: var(--ink); background: transparent;
  border: 0; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.total { text-align: right; color: var(--muted); font-size: 14px; margin-top: -6px; }

.btn {
  font: 600 17px var(--body); color: #fff; background: var(--night-2); border: 0; border-radius: 14px;
  padding: 15px 18px; cursor: pointer; width: 100%; text-align: center; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--night); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.small { font-size: 14px; padding: 10px 14px; width: auto; border-radius: 10px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--gold); }
.error { color: var(--err); font-size: 14px; margin: 0; }

.done { padding: 28px 22px; display: grid; gap: 14px; text-align: center; justify-items: center; }
.seal { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft); color: var(--gold);
  display: grid; place-items: center; font-size: 30px; }
.done p { margin: 0; color: var(--muted); }
.done a.again { color: var(--muted); }
footer { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Admin ---------- */
.login { max-width: 380px; margin: 10vh auto 0; }
.login .pad { display: grid; gap: 14px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.top h1 { font-size: 28px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat .n { font-family: var(--display); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .07em; }
.stat.main { background: var(--night-2); color: #fff; border-color: transparent; }
.stat.main .l { color: #e9c77e; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
td.num, th.num { text-align: center; }
td form { margin: 0; }
.del { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.del.sure { background: var(--err-soft); color: var(--err); border-color: var(--err); }
.empty { text-align: center; padding: 28px 8px; color: var(--muted); white-space: normal; }
.search { max-width: 260px; padding: 9px 12px !important; }
.notice { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 0; }

@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .row { grid-template-columns: 1fr; gap: 2px; } }
@media (prefers-reduced-motion: no-preference) { .done { animation: rise .35s ease-out; } }
@keyframes rise { from { transform: translateY(6px); opacity: .4; } to { transform: none; opacity: 1; } }
