/* Vote des maquettes — page de vote (index.html) et admin (admin.php) */
:root {
  --bg: #ECEBE7; --v-card: #F9F8F5; --ink: #151515; --ink-2: #45443F; --ink-3: #85837D; --line: rgba(21, 21, 21, .13);
  --go: #2F9E66; --go-ink: #0b2416; --bad: #C62E2E; --focus: #2f6bff;
  --ease: cubic-bezier(.2, .9, .1, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink-2); font: 400 1rem/1.55 'Be Vietnam Pro', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }
.admin .wrap { max-width: 1100px; }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.6rem); }
h2 { font-size: 1.2rem; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.eyebrow { margin: 0 0 6px; font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: transform .25s var(--ease), background-color .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn--main { background: var(--ink); color: #fff; }
.btn--go { background: var(--go); border-color: var(--go); color: #fff; }
.btn--ghost { border-color: var(--line); background: transparent; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .86rem; }
.btn--danger { border-color: var(--bad); color: var(--bad); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card { background: var(--v-card); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px; }
.alert { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fde8e8; color: #7a1414; font-size: .92rem; }
.info { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: .92rem; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; color: var(--ink); font-size: .92rem; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-size: 1rem; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 21, 21, .1); }
.field.is-bad input, .field.is-bad textarea { border-color: var(--bad); }
.field small { color: var(--ink-3); font-size: .8rem; }

/* --- page de vote -------------------------------------------------------- */
.v-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 8px 0 18px; }
.v-head img { width: 56px; height: 56px; }
.v-intro { margin: 0 0 22px; font-size: 1.02rem; }
.v-step { margin-top: 14px; }
.v-step h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.v-step h2 i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-size: .85rem; flex: none; }
.v-names { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v-hint { margin: 12px 0 0; font-size: .82rem; color: var(--ink-3); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; cursor: pointer; transition: border-color .2s, box-shadow .25s var(--ease); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice__body { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; }
.choice__body b { color: var(--ink); font-size: 1.05rem; display: block; }
.choice__body small { color: var(--ink-3); font-size: .8rem; }
.choice__tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.choice:has(input:checked) .choice__tick { background: var(--ink); border-color: var(--ink); }
.choice:has(input:checked) .choice__tick::after { content: ''; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.see { display: inline-flex; align-items: center; gap: 4px; padding: 0 14px 12px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.see:hover { color: var(--ink); }

.shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #ddd; }
.shot > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot.is-live > img { display: none; }
.shot iframe { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }

.pals { display: grid; gap: 8px; }
.pal { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .2s; }
.pal input { position: absolute; opacity: 0; pointer-events: none; }
.pal:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pal:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.pal b { display: block; color: var(--ink); font-size: .98rem; line-height: 1.25; }
.pal b em { font-style: normal; display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: 1px; }
.pal b em.p { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pal small { display: block; color: var(--ink-3); font-size: .8rem; line-height: 1.35; }
.pal .see { padding: 6px 4px; }
.pals__sep { margin: 10px 2px 2px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

.chips { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.chips i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; margin-left: -7px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
.chips i:first-child { margin-left: 0; }
.pal .chips { margin: 0; }

.propose { margin-top: 12px; border: 1.5px dashed var(--line); border-radius: 16px; background: #fff; }
.propose > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.propose > summary::-webkit-details-marker { display: none; }
.propose > summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--ink-3); }
.propose[open] > summary::after { content: '–'; }
.propose__body { display: grid; gap: 14px; padding: 0 16px 16px; }
.colors { display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) 52px 100px; gap: 10px; align-items: center; }
.crow b { display: block; color: var(--ink); font-size: .92rem; }
.crow small { display: block; color: var(--ink-3); font-size: .76rem; line-height: 1.25; }
.crow input[type=color] { width: 52px; height: 46px; padding: 2px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.crow input[type=text] { width: 100%; height: 46px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 12px; font: 600 .9rem/1 ui-monospace, Menlo, monospace; text-transform: uppercase; background: #fff; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.submit { position: sticky; bottom: 0; margin: 18px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 28%); }
.submit .btn { width: 100%; min-height: 56px; font-size: 1.05rem; }
.msg { margin-top: 10px; }
.done { text-align: center; padding: 36px 20px; }
.done__ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--go); display: grid; place-items: center; }
.done__ic svg { width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done p { margin: 10px auto 0; max-width: 30em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

@media (max-width: 520px) {
  .v-names, .choices { grid-template-columns: 1fr; }
  .choice { flex-direction: row; }
  .choice .shot { width: 42%; aspect-ratio: 4 / 3; flex: none; }
  .choice__main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .crow { grid-template-columns: minmax(0, 1fr) 48px 92px; }
}

/* --- admin ----------------------------------------------------------------- */
.login { max-width: 400px; margin: 10vh auto 0; display: grid; gap: 14px; text-align: center; }
.login .logo { margin: 0 auto; }
.login .field { text-align: left; }
.adm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 12px 0 14px; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-actions form { margin: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.status i { width: 10px; height: 10px; border-radius: 50%; }
.status.is-open i { background: var(--go); }
.status.is-closed i { background: var(--bad); }
.admin section { margin-bottom: 16px; }
.admin h2 { margin-bottom: 14px; }
.admin h2 .muted { font-weight: 400; font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.bar { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr) 2.5em 3.5em; gap: 12px; align-items: center; padding: 7px 0; font-size: .92rem; }
.bar__k { display: flex; align-items: center; color: var(--ink); font-weight: 600; min-width: 0; }
.bar__t { height: 12px; border-radius: 99px; background: rgba(21, 21, 21, .07); overflow: hidden; }
.bar__t i { display: block; height: 100%; border-radius: 99px; background: var(--ink); min-width: 2px; }
.bar b { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.bar small { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.tag { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); font-size: .7rem; font-weight: 600; color: var(--ink-3); }
.qr-card { text-align: center; }
.qr { display: block; width: min(240px, 100%); margin: 14px auto; background: #fff; border: 0; border-radius: 12px; padding: 6px; cursor: zoom-in; }
.qr-big { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; background: rgba(15, 15, 16, .92); color: #fff; text-align: center; cursor: zoom-out; }
.qr-big__box { width: min(78vmin, 560px); padding: 3vmin; border-radius: 24px; background: #fff; }
.qr-big__box svg { width: 100%; height: auto; }
.qr-big p { margin: 0; font-size: 1.2rem; font-weight: 600; }
.qr-big small { opacity: .6; }
.qr svg { width: 100%; height: auto; }
.qr-url { margin: 0 0 14px; font-size: .82rem; word-break: break-all; }
.prop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.prop__txt p { margin: 4px 0; }
.prop__txt code { font-size: .78rem; color: var(--ink-3); }
.prop__act { display: flex; gap: 6px; }
.prop__act form { margin: 0; }
.empty { margin: 0; padding: 18px; border-radius: 12px; background: #fff; color: var(--ink-3); text-align: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); }
th { color: var(--ink-3); font-weight: 600; font-size: .8rem; border-top: 0; }
td form { margin: 0; }
.nowrap { white-space: nowrap; }
.link-danger { border: 0; background: none; color: var(--bad); cursor: pointer; font-size: .86rem; padding: 4px; }
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: minmax(0, 1fr) 2em 3em; }
  .bar__t { grid-column: 1 / -1; grid-row: 2; }
  .prop { grid-template-columns: auto minmax(0, 1fr); }
  .prop__act { grid-column: 1 / -1; }
}
@media print {
  .admin .wrap > *:not(.grid2), .grid2 > .card:not(.qr-card), .qr-card .btn, .qr-card .muted { display: none !important; }
  .grid2 { display: block; }
  .qr-card { border: 0; }
  .qr { width: 70%; }
}

.pal--mine { margin-top: 8px; border-style: dashed; grid-template-columns: auto minmax(0, 1fr); }
.chips.plus { position: relative; }
.chips.plus::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.3rem; text-shadow: 0 0 3px rgba(0, 0, 0, .7); }
.mine { margin-top: 10px; padding: 14px; border-radius: 16px; background: #fff; border: 1.5px solid var(--ink); }
