/* Style faire-part : carton clair, double cadre fin, lettres classiques, une seule couleur bordeaux */
:root {
  --table: #ecebe7;   /* fond autour du carton */
  --card: #fbfbf9;    /* le carton */
  --ink: #1c1c1a;
  --soft: #75736d;
  --rule: #1c1c1a;
  --wine: #5b1a26;
  --wine-dark: #45121c;
  --err: #9b1c1c;
  --serif: 'David Libre', Georgia, 'Times New Roman', serif;
  --sans: 'Karla', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--table); color: var(--ink); font: 16px/1.6 var(--sans);
  padding-block: 28px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Le carton ---------- */
.carton { max-width: 480px; margin: 0 auto; background: var(--card); padding: 14px; box-shadow: 0 1px 2px #0000001a, 0 8px 24px #0000000f; }
.frame { border: 1px solid var(--rule); outline: 1px solid var(--rule); outline-offset: 5px; margin: 6px; padding: 30px 22px 28px; text-align: center; }
.bsd { font-family: var(--serif); font-size: 15px; color: var(--soft); margin: 0; text-align: right; }
.lead { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--soft); margin: 18px 0 2px; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 9vw, 40px); line-height: 1.1; margin: 0; text-wrap: balance; }
.orn { color: var(--wine); letter-spacing: .5em; margin: 18px 0 16px; font-size: 12px; padding-left: .5em; }
.info { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; line-height: 2; }
.info b { color: var(--wine); font-weight: 600; }
.public { font-family: var(--serif); font-style: italic; color: var(--soft); margin: 12px 0 0; font-size: 16px; }
.links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.links a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.links a:hover, .links a:focus-visible { color: var(--wine); border-color: var(--wine); outline: none; }

/* ---------- Formulaire ---------- */
.sep { border: 0; border-top: 1px solid var(--rule); width: 40%; margin: 26px auto 22px; }
form.rsvp { display: grid; gap: 16px; text-align: left; }
.rsvp-title { font-family: var(--serif); font-size: 22px; text-align: center; margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--soft); }
input[type=text], input[type=password], input[type=search] {
  font: 18px var(--serif); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  border-radius: 0; padding: 6px 0; width: 100%; min-width: 0;
}
input:focus { outline: none; border-bottom: 2px solid var(--wine); padding-bottom: 5px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cnt { display: flex; justify-content: space-between; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--ink);
  font: 18px/1 var(--sans); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.stepper button:hover { border-color: var(--wine); color: var(--wine); }
.stepper button:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.stepper input {
  width: 34px; text-align: center; font: 22px var(--serif); color: var(--ink); background: transparent; border: 0;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; padding: 0;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.total { text-align: right; color: var(--soft); font-family: var(--serif); font-style: italic; font-size: 15px; margin-top: -6px; }

.btn {
  background: var(--wine); color: #fff; border: 0; border-radius: 0; padding: 14px 18px; cursor: pointer; width: 100%;
  font: 600 13px var(--sans); letter-spacing: .16em; text-transform: uppercase; text-align: center; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--wine-dark); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.line { background: transparent; color: var(--ink); border: 1px solid var(--rule); width: auto; padding: 9px 14px; font-size: 11px; }
.btn.line:hover { color: var(--wine); border-color: var(--wine); }
.error { color: var(--err); font-size: 14px; margin: 0; text-align: center; }

.done { display: grid; gap: 10px; justify-items: center; }
.done .check { font-family: var(--serif); font-size: 26px; color: var(--wine); }
.done h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 0; }
.done p { margin: 0; color: var(--soft); font-family: var(--serif); font-size: 17px; }
.done a { color: var(--ink); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-top: 8px; }

/* ---------- Admin ---------- */
.carton.wide { max-width: 860px; }
.frame.left { text-align: left; }
.login .frame { display: grid; gap: 18px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.top h1 { font-size: 32px; }
.sub { color: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 24px 0; }
.stat { padding: 14px 8px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat .n { font-family: var(--serif); font-size: 38px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat.main .n { color: var(--wine); }
.stat .l { color: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.listhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.listhead h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0; }
.search { max-width: 230px; font-size: 16px !important; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #1c1c1a26; white-space: nowrap; }
th { color: var(--soft); font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; border-bottom-color: var(--rule); }
td { font-family: var(--serif); font-size: 17px; }
td.num, th.num { text-align: center; }
td form { margin: 0; }
.del { background: none; border: 0; color: var(--soft); cursor: pointer; font: 11px var(--sans); text-transform: uppercase; letter-spacing: .1em; text-decoration: underline; padding: 4px; }
.del.sure { color: var(--err); font-weight: 600; }
.empty { text-align: center; padding: 26px 8px; color: var(--soft); white-space: normal; font-style: italic; }
.notice { font-family: var(--serif); font-style: italic; color: var(--wine); margin: 16px 0 0; }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 380px) { .frame { padding: 24px 14px; } .two { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) { .done { animation: rise .4s ease-out; } }
@keyframes rise { from { transform: translateY(6px); opacity: .3; } to { transform: none; opacity: 1; } }
