/* Portail du mariage — ivoire, bleu nuit et or ; vert sauge pour les arrivées.
   Lisible en plein soleil comme à la nuit tombée (thème sombre automatique). */

@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/cormorant-latin.woff2') format('woff2');
  font-weight: 500 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/cormorant-latin-ext.woff2') format('woff2');
  font-weight: 500 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/cormorant-italic.woff2') format('woff2');
  font-weight: 500; font-style: italic; font-display: swap;
}

:root {
  --bg: #f7f2e9;
  --bg-glow: #fdf9f1;
  --surface: #fffdf8;
  --surface-2: #faf5ea;
  --ink: #1b2340;
  --ink-soft: #4b5169;
  --muted: #8b8578;
  --line: #ebe2d0;
  --gold: #b08d4c;
  --gold-deep: #86662c;
  --gold-soft: #f4ead5;
  --gold-line: #e3d2a9;
  --sage: #2e6d52;
  --sage-btn: #2f7a57;
  --sage-soft: #e7f2eb;
  --sage-line: #bcd8c7;
  --danger: #a3302a;
  --danger-soft: #f6dcda;
  --night-1: #161d36;
  --night-2: #242e54;
  --shadow: 0 1px 2px rgba(27, 35, 64, .05), 0 10px 28px -16px rgba(27, 35, 64, .28);
  --shadow-lift: 0 2px 4px rgba(27, 35, 64, .06), 0 18px 40px -18px rgba(27, 35, 64, .38);
  --serif: 'Cormorant', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --radius: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1222;
    --bg-glow: #151c33;
    --surface: #161d33;
    --surface-2: #1b2340;
    --ink: #f3eee4;
    --ink-soft: #cfc8b9;
    --muted: #8f897d;
    --line: #273152;
    --gold: #d6b26b;
    --gold-deep: #e6c483;
    --gold-soft: rgba(214, 178, 107, .12);
    --gold-line: rgba(214, 178, 107, .35);
    --sage: #79c9a1;
    --sage-btn: #2f8a62;
    --sage-soft: rgba(121, 201, 161, .11);
    --sage-line: rgba(121, 201, 161, .35);
    --danger: #f08b84;
    --danger-soft: rgba(240, 139, 132, .25);
    --night-1: #0b1020;
    --night-2: #18213f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 44px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  font-variant-numeric: lining-nums;
  margin: 0; min-height: 100vh;
  font-family: var(--sans); color: var(--ink);
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow), var(--bg) 60%) fixed;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 720px; margin: 0 auto; padding: 4px 16px calc(110px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- en-tête */
header.top {
  position: sticky; top: 0; z-index: 5; color: #f6f0e3;
  background: linear-gradient(120deg, var(--night-1), var(--night-2));
  padding: calc(10px + env(safe-area-inset-top)) 16px 11px;
  box-shadow: inset 0 -1px 0 rgba(214, 178, 107, .45), 0 8px 24px -16px rgba(0, 0, 0, .6);
}
header.top .row { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.monogram { width: 34px; height: 34px; flex: none; }
.brand { flex: 1; min-width: 0; line-height: 1.05; }
.brand .title { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #d6b26b; margin-top: 3px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 99px; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.pill .led { width: 8px; height: 8px; border-radius: 99px; background: #6fd39f; animation: pulse 2.4s infinite; }
.pill.off { background: rgba(217, 119, 6, .92); }
.pill.off .led { background: #fff; animation: none; }
.pill.wait { background: rgba(214, 178, 107, .25); color: #f3dcaa; }
.pill.wait .led { background: #d6b26b; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(111, 211, 159, .6); } 70% { box-shadow: 0 0 0 7px rgba(111, 211, 159, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 211, 159, 0); } }

/* ---------------------------------------------------------------- recherche */
.search { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 4; padding: 14px 0 10px; background: linear-gradient(var(--bg) 78%, transparent); }
.search .field { position: relative; }
.search .field > svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--gold); width: 22px; height: 22px; }
.search .field input {
  width: 100%; height: 60px; font-size: 19px; padding: 0 56px 0 52px;
  border: 1.5px solid var(--gold-line); border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow); outline: none; transition: border-color .15s, box-shadow .15s;
}
.search .field input::placeholder { color: var(--muted); }
.search .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft), var(--shadow); }
.search .clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; border-radius: 99px; background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center; }
.hint { color: var(--muted); margin: 2px 4px 14px; font-family: var(--serif); font-style: italic; font-size: 18px; }

/* ---------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.guest { display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; }
.guest.arrived { background: linear-gradient(90deg, var(--sage-soft), var(--surface) 80%); border-color: var(--sage-line); }
.guest.arrived::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--sage); }
.guest .who { flex: 1; min-width: 0; }
.guest .name { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.seat { margin-top: 10px; display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px 7px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--gold-line); max-width: 100%; }
.seat small { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep); }
.seat b { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--gold-deep); line-height: 1.05; }
.meta { color: var(--muted); font-size: 14px; margin-top: 8px; display: flex; align-items: flex-start; gap: 6px; }
.meta svg { margin-top: 1px; }
.meta.ok { color: var(--sage); font-weight: 650; }
.extra-tag { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 99px; font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 0 18px; min-height: 50px; font-weight: 650; font-size: 16px;
  background: var(--ink); color: var(--surface); transition: transform .08s, filter .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.go { min-height: 56px; padding: 0 20px; border-radius: 99px; font-size: 17px; background: linear-gradient(180deg, #3a9068, var(--sage-btn)); color: #fff; box-shadow: 0 8px 18px -10px rgba(47, 122, 87, .9); }
.btn.gold { background: linear-gradient(180deg, #c7a462, #a88444); color: #fff; box-shadow: 0 8px 18px -10px rgba(176, 141, 76, .9); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.soft { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.btn.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--danger-soft); }
.btn.danger.solid { background: #a3302a; color: #fff; border: 0; }
.btn.small { min-height: 40px; padding: 0 13px; font-size: 14.5px; border-radius: 12px; }
.btn.round { width: 36px; min-height: 36px; padding: 0; border-radius: 99px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btns.end { justify-content: flex-end; }
.btns.split { justify-content: space-between; }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.stepper b { min-width: 2.6em; text-align: center; font-family: var(--serif); font-size: 21px; }
.stepper .btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- bilan */
.hero { background: linear-gradient(135deg, var(--night-1), var(--night-2)); color: #f6f0e3; border: 0; padding: 20px 20px 22px; }
.hero .over { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #d6b26b; }
.hero .big { font-family: var(--serif); font-size: 56px; font-weight: 600; line-height: 1; margin: 10px 0 2px; }
.hero .big span { font-size: 28px; color: #b9b2a3; }
.hero .cap { font-family: var(--serif); font-style: italic; font-size: 19px; color: #cfc8b9; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; margin-top: 16px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #c7a462, #ecd29a); transition: width .4s ease; }
.card .bar.light { background: var(--gold-soft); margin-top: 0; height: 4px; border-radius: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 13px 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-size: 31px; font-weight: 600; line-height: 1.05; }
.stat span { color: var(--muted); font-size: 12.5px; }

h2 { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 600; font-size: 23px; color: var(--ink); margin: 26px 4px 4px; }
h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-line), transparent); }

/* ---------------------------------------------------------------- tables */
.table-card { padding: 0; overflow: hidden; }
.table-card .head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; cursor: pointer; }
.table-card .head .title { flex: 1; min-width: 0; }
.table-card .head .over { font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); }
.table-card .head .name { font-family: var(--serif); font-size: 27px; font-weight: 700; line-height: 1.05; }
.table-card .head .note { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 17px; }
.count { font-family: var(--serif); font-weight: 700; font-size: 23px; color: var(--ink); white-space: nowrap; }
.count small { color: var(--muted); font-weight: 500; font-size: 18px; }
.chev { color: var(--muted); transition: transform .2s; }
.chev.open { transform: rotate(180deg); }
.table-card .body { border-top: 1px solid var(--line); background: var(--surface-2); padding: 4px 16px 14px 18px; }
.table-card ul { list-style: none; padding: 0; margin: 0; }
.table-card li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.table-card li:last-child { border-bottom: 0; }
.table-card li .n { flex: 1; min-width: 0; font-size: 16px; font-weight: 550; }
.table-card li .n em { display: block; font-style: normal; font-weight: 400; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.check { width: 26px; height: 26px; border-radius: 99px; border: 1.5px solid var(--gold-line); flex: none; display: grid; place-items: center; }
.check.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.check.on svg { width: 15px; height: 15px; stroke-width: 3; }
.table-card .actions { margin-top: 12px; }

/* ---------------------------------------------------------------- formulaires */
form.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 650; font-size: 14px; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font-size: 17px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }

/* ---------------------------------------------------------------- navigation */
nav.tabs {
  position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 6; max-width: 560px; margin: 0 auto;
  display: flex; padding: 6px; gap: 4px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 84%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow-lift);
}
nav.tabs button { flex: 1; border: 0; background: none; padding: 8px 2px 7px; border-radius: 18px; font-size: 11.5px; font-weight: 650; color: var(--muted); display: grid; justify-items: center; gap: 3px; }
nav.tabs button svg { width: 23px; height: 23px; }
nav.tabs button.on { color: var(--gold-deep); background: var(--gold-soft); }

/* ---------------------------------------------------------------- fenêtres */
dialog { border: 0; border-radius: 26px; padding: 22px; width: min(92vw, 480px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(11, 16, 32, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog h3 { font-family: var(--serif); font-size: 29px; font-weight: 600; margin: 0 0 8px; line-height: 1.1; }
dialog p { color: var(--ink-soft); line-height: 1.45; margin: 0 0 18px; }
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: 92vw;
  background: linear-gradient(120deg, #161d36, #242e54); color: #f6f0e3; padding: 13px 18px; border-radius: 16px;
  font-weight: 600; box-shadow: var(--shadow-lift); animation: rise .25s ease;
}
.toast svg { color: #d6b26b; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------------------------------------------------------- connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 20px; background: radial-gradient(120% 70% at 50% 0%, #2a3560, #121933 70%); color: #f6f0e3; }
.login .box { width: 100%; max-width: 400px; text-align: center; }
.login .monogram { width: 82px; height: 82px; margin: 0 auto 14px; }
.login .over { font-size: 11.5px; letter-spacing: .32em; text-transform: uppercase; color: #d6b26b; }
.login h1 { font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: 1.02; margin: 12px 0 6px; }
.login .tag { font-family: var(--serif); font-style: italic; font-size: 21px; color: #cfc8b9; }
.ornament { display: flex; align-items: center; gap: 10px; color: #d6b26b; margin: 22px auto 24px; max-width: 220px; }
.ornament::before, .ornament::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(214, 178, 107, .8), transparent); }
.ornament svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.login form { text-align: left; background: rgba(255, 255, 255, .06); border: 1px solid rgba(214, 178, 107, .25); border-radius: 24px; padding: 20px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.login label { color: #d9d2c3; }
.login input[type=text], .login input[type=password] { background: rgba(255, 255, 255, .96); color: #1b2340; border-color: transparent; }
.err { color: #ffb4ad; font-weight: 600; min-height: 1.2em; margin: 0; }

.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty p { font-family: var(--serif); font-style: italic; font-size: 22px; margin: 0 0 16px; }
.row-line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row-line:last-child { border-bottom: 0; }
.row-line span { flex: 1; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.row-line .mini-bar { width: 70px; height: 5px; border-radius: 99px; background: var(--gold-soft); overflow: hidden; }
.row-line .mini-bar i { display: block; height: 100%; background: var(--gold); }
.row-line b { min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }
.loading { min-height: 100vh; display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
