/* ===== Variables : thème « Gala à l'ivoirienne » =====
   Orange, blanc et vert du drapeau de la Côte d'Ivoire, or des parures, fond brun profond
   et bandeau tissé façon pagne kente. */
:root {
  --ink: #120b06; --navy: #1e130a; --navy-2: #2a1a0d; --line: rgba(232, 163, 61, .30);
  --gold: #e3a43c; --gold-2: #f7d488; --ivory: #fbf5e9; --muted: #c2b29a;
  --orange: #f77f00; --green: #009e60; --white: #ffffff;
  --ok: #1fb174; --warn: #f7a21b; --bad: #d8434b;
  --kente: repeating-linear-gradient(90deg,
    var(--orange) 0 22px, var(--gold) 22px 26px, var(--white) 26px 34px, var(--gold) 34px 38px,
    var(--green) 38px 60px, #1e130a 60px 64px);
  --serif: "Cormorant Garamond", "Playfair Display", "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ivory); background: var(--ink); line-height: 1.55; min-height: 100vh; }
body.public { background:
    radial-gradient(900px 520px at 8% -8%, rgba(247, 127, 0, .30) 0%, transparent 62%),
    radial-gradient(900px 520px at 92% -8%, rgba(0, 158, 96, .26) 0%, transparent 62%),
    radial-gradient(1200px 700px at 50% 120%, rgba(227, 164, 60, .10) 0%, transparent 70%) fixed;
  background-color: var(--ink); }
/* Bandeau tissé (pagne kente) en haut des pages et sous la barre du personnel */
body.public::before, .staffbar::before { content: ""; display: block; height: 6px; background: var(--kente); }
img { max-width: 100%; display: block; }
a { color: var(--gold-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); color: var(--gold-2); }
.container { width: min(1040px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(640px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Topbar ===== */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); background: rgba(18, 11, 6, .82); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { font-family: var(--serif); font-size: 1.2rem; color: var(--gold-2); text-decoration: none; display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand img { height: 30px; width: auto; }
.topbar nav { display: flex; gap: 18px; align-items: center; font-size: .92rem; }
.topbar nav a { color: var(--ivory); text-decoration: none; opacity: .85; }
.topbar nav a:hover { opacity: 1; color: var(--gold-2); }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 999px;
  font: 600 .95rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; border: 1px solid var(--gold);
  color: var(--gold-2); background: transparent; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(247, 127, 0, .28); }
.btn.primary { background: linear-gradient(135deg, #ffb347, var(--orange) 55%, #c95f00); color: #1a0d02; border-color: transparent; }
.btn.primary:hover { box-shadow: 0 8px 26px rgba(247, 127, 0, .45); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .78rem; letter-spacing: .04em; }
.btn.danger { border-color: var(--bad); color: #ff9ea4; }
.btn.ok { border-color: var(--ok); color: #7be3b5; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }

/* ===== Hero invitation ===== */
.hero { padding: 36px 0 24px; }
.invitation { position: relative; margin-inline: auto; width: min(720px, 100% - 24px); padding: clamp(28px, 6vw, 56px) clamp(18px, 5vw, 48px); text-align: center;
  background: linear-gradient(180deg, rgba(42, 26, 13, .94), rgba(22, 13, 6, .97)); border: 1px solid var(--gold); border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 0 6px rgba(18, 11, 6, .9), inset 0 0 0 7px var(--line); animation: rise .9s ease both;
  overflow: hidden; }
.invitation::before, .invitation::after { content: ""; position: absolute; left: 0; right: 0; height: 8px; background: var(--kente); }
.invitation::before { top: 0; } .invitation::after { bottom: 0; }
.corner { position: absolute; width: 46px; height: 46px; border: 2px solid var(--gold); opacity: .9; }
.corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; } .corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; } .corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.logo-mark { width: 84px; height: 84px; margin: 0 auto 14px; display: grid; place-items: center; animation: rise .9s .1s ease both; }
.logo-mark img { max-height: 84px; width: auto; }
.eyebrow { letter-spacing: .35em; text-transform: uppercase; font-size: .72rem; color: var(--gold); margin: 0 0 10px; animation: rise .9s .15s ease both; }
.invitation h1 { font-size: clamp(2.2rem, 8vw, 3.8rem); margin-bottom: .1em; background: linear-gradient(100deg, #ffd08a 15%, var(--orange) 38%, var(--gold-2) 52%, #3fd08f 70%, #ffd08a 88%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise .9s .2s ease both, shimmer 6s 1s linear infinite; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 1.25rem; margin: 0 0 6px; animation: rise .9s .25s ease both; }
.theme-line { color: var(--gold-2); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin: 0 0 22px; animation: rise .9s .3s ease both; }
.hero-art { margin: 0 auto 22px; max-height: 240px; width: 100%; border-radius: 4px; object-fit: cover; border: 1px solid var(--line); animation: rise .9s .35s ease both; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0 0 26px; animation: rise .9s .4s ease both; }
.facts div { border-top: 1px solid var(--line); padding-top: 12px; }
.facts dt { font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); }
.facts dd { margin: 4px 0 0; font-family: var(--serif); font-size: 1.25rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; animation: rise .9s .5s ease both; }

/* ===== Countdown ===== */
.countdown-wrap { margin: 6px 0 28px; animation: rise .9s .45s ease both; }
.countdown-label { font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 480px; margin-inline: auto; }
.countdown .unit { border: 1px solid var(--line); border-top: 3px solid var(--orange); border-radius: 6px; padding: 12px 4px 8px; background: rgba(18, 11, 6, .6); }
.countdown .unit:nth-child(even) { border-top-color: var(--green); }
.countdown .num { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 1; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.countdown .lbl { font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.countdown-done { font-family: var(--serif); font-size: 1.8rem; color: var(--gold-2); }

/* ===== Sections / cards ===== */
section.block { padding: 56px 0 8px; }
section.block > .container > h2, section.block > .narrow > h2 { text-align: center; }
.lead { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.panel { background: linear-gradient(180deg, rgba(42, 26, 13, .72), rgba(22, 13, 6, .88)); border: 1px solid var(--line); border-radius: 10px; padding: clamp(18px, 4vw, 30px); }
.grid-tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.ticket-card { display: flex; flex-direction: column; position: relative; transition: transform .25s, border-color .25s; }
.ticket-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.ticket-card { border-top: 4px solid var(--orange); } .ticket-card:nth-child(2) { border-top-color: var(--white); }
.ticket-card:nth-child(3) { border-top-color: var(--green); }
.ticket-card.featured { border-color: var(--gold); box-shadow: 0 0 40px rgba(247, 127, 0, .18); }
.ticket-card h3 { font-size: 1.7rem; color: var(--gold-2); }
.price { font-family: var(--serif); font-size: 2.4rem; color: var(--ivory); line-height: 1; margin: 6px 0 2px; }
.perks { list-style: none; padding: 0; margin: 14px 0 18px; flex: 1; }
.perks li { padding: 6px 0 6px 24px; position: relative; border-top: 1px solid rgba(255, 255, 255, .06); font-size: .92rem; }
.perks li::before { content: "◆"; position: absolute; left: 0; color: var(--orange); font-size: .65rem; top: 10px; }
.perks li:nth-child(even)::before { color: var(--green); }
.badge { display: inline-block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold-2); }
.badge.ok { border-color: var(--ok); color: #7be3b5; } .badge.warn { border-color: var(--warn); color: #ffc274; }
.badge.bad { border-color: var(--bad); color: #ff9ea4; } .badge.muted { color: var(--muted); }
.stock { font-size: .8rem; color: var(--warn); margin-bottom: 10px; min-height: 1.2em; }

/* ===== Forms ===== */
label { display: block; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-2); margin: 14px 0 6px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--ivory); background: rgba(18, 11, 6, .82);
  border: 1px solid rgba(232, 163, 61, .38); border-radius: 6px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--orange); }
.checkline { display: flex; gap: 10px; align-items: center; text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ivory); }
.row { display: grid; gap: 14px; grid-template-columns: 1fr; } @media (min-width: 640px) { .row.two { grid-template-columns: 1fr 1fr; } }
.phone { display: grid; grid-template-columns: 38% 1fr; gap: 8px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.alert { padding: 12px 16px; border-radius: 6px; margin: 0 0 16px; border: 1px solid; }
.alert.error { border-color: var(--bad); background: rgba(216, 67, 75, .12); color: #ffc3c6; }
.alert.ok { border-color: var(--ok); background: rgba(31, 169, 113, .12); color: #b9f2d8; }
.alert.warn { border-color: var(--warn); background: rgba(240, 140, 26, .12); color: #ffd9a8; }
.notice { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--orange); padding-left: 12px; margin: 14px 0; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--serif); font-size: 1.6rem; margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ===== Paiement / commande ===== */
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 16px; }
.pay-methods label.method { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ivory); }
.pay-methods input:checked + span { color: var(--gold-2); font-weight: 600; }
.qr-box { display: none; text-align: center; margin: 10px 0 18px; } .qr-box.active { display: block; }
.qr-box img { margin: 0 auto; width: min(260px, 70vw); background: #fff; padding: 10px; border-radius: 8px; }
.steps { padding-left: 20px; color: var(--ivory); } .steps li { margin: 6px 0; }
.ticket-item { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.ticket-item img.qr { width: 150px; background: #fff; padding: 6px; border-radius: 6px; }
.ticket-item .num { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--gold-2); letter-spacing: .06em; }
@media (max-width: 520px) { .ticket-item { grid-template-columns: 1fr; text-align: center; } .ticket-item img.qr { margin: 0 auto; } }
.footer { margin-top: 64px; padding: 28px 0 40px; text-align: center; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); position: relative; }
.footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 4px; background: var(--kente); opacity: .85; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px;
  vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

/* ===== Animations ===== */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s; } .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } html { scroll-behavior: auto; } }

/* ===== Espace personnel (admin / réception / sécurité) ===== */
body.staff { background: #140d07; }
.staffbar { background: #1e130a; border-bottom: 1px solid var(--line); }
.staffbar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 0; }
.staffbar nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-right: auto; }
.staffbar nav a { color: var(--ivory); text-decoration: none; padding: 6px 2px; opacity: .8; border-bottom: 2px solid transparent; }
.staffbar nav a.active, .staffbar nav a:hover { opacity: 1; border-color: var(--orange); }
.staffbar form { margin: 0; } .who { font-size: .85rem; color: var(--muted); }
.page { padding: 24px 0 60px; } .page h1 { font-size: 1.9rem; color: var(--gold-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 24px; }
.stat { background: var(--navy); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 8px; padding: 14px 16px; }
.stat:nth-child(3n+2) { border-left-color: var(--white); } .stat:nth-child(3n) { border-left-color: var(--green); }
.stat .v { font-family: var(--serif); font-size: 2rem; color: var(--gold-2); line-height: 1.1; } .stat .k { font-size: .78rem; color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; } th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: top; }
th { background: #2a1a0d; color: var(--gold-2); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; position: sticky; top: 0; }
tr.row-used td { opacity: .6; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; } .toolbar input, .toolbar select { width: auto; min-height: 40px; }
.toolbar input[type=search] { flex: 1 1 220px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: transparent; color: var(--ivory); cursor: pointer; font: inherit; font-size: .85rem; }
.chip.active { background: var(--orange); color: #1a0d02; border-color: var(--orange); }
.inline { display: inline; margin: 0; } .inline input { width: auto; min-height: 34px; padding: 4px 8px; font-size: .85rem; }
details.fold summary { cursor: pointer; color: var(--gold-2); } details.fold form { margin-top: 8px; }
.login-card { margin: 12vh auto 0; }

/* ===== Scanner ===== */
.scan-wrap { max-width: 560px; margin: 0 auto; }
#viewport { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 4/3; border: 1px solid var(--line); }
#viewport video { width: 100%; height: 100%; object-fit: cover; }
#viewport .frame { position: absolute; inset: 18% 18%; border: 2px solid rgba(236, 212, 145, .8); border-radius: 12px; pointer-events: none; }
#result { display: none; position: fixed; inset: 0; z-index: 50; padding: 24px; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; }
#result.show { display: flex; } #result.GREEN { background: #12805a; } #result.RED { background: #b4232b; } #result.ORANGE { background: #d9780b; }
#result .big { font-size: clamp(3rem, 16vw, 6rem); font-weight: 800; letter-spacing: .06em; line-height: 1; }
#result .msg { font-size: 1.3rem; margin: 14px 0; } #result .who { font-size: 1.9rem; font-family: var(--serif); color: #fff; } #result .sub { opacity: .9; margin-bottom: 10px; }
#result .time { font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 26px; }
#result .time:empty { display: none; }
#result button { min-height: 52px; padding: 0 32px; border-radius: 999px; border: 2px solid #fff; background: transparent; color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ===== Compléments : scanner, listes, formulaires du personnel ===== */
.recent { list-style: none; padding: 0; margin: 0; }
.recent li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-left: 4px solid var(--line); background: var(--navy); margin-bottom: 4px; border-radius: 4px; font-size: .9rem; }
.recent li.scan-GREEN { border-color: #12805a; } .recent li.scan-RED { border-color: #b4232b; } .recent li.scan-ORANGE { border-color: #d9780b; }
.recent li small { color: var(--muted); text-align: right; }
fieldset legend { padding: 0 8px; color: var(--gold-2); font-size: .85rem; }
.btn.small.danger, .btn.small.ok { min-height: 34px; }
