/* Plnr — page événement web (participation invité) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #3B82F6; --blue-ink: #1D4ED8; --bg: #F8FAFC; --text: #1E293B;
  --muted: #64748B; --border: #E2E8F0; --white: #fff;
  --success: #10B981; --error: #EF4444; --warning: #F59E0B;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
button { font-family: inherit; }

.ev-loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Landing / formulaire ===== */
.ev-gate {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.ev-gate .logo { font-size: 26px; font-weight: 800; color: var(--blue); margin-bottom: 28px; text-decoration: none; }
.ev-gate-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px 28px; max-width: 420px; width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,.06);
}
.ev-gate-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; }
.ev-gate-card .ev-date { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.ev-gate-card .ev-members { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.ev-gate-card p.hint { color: var(--muted); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.ev-gate-card input {
  width: 100%; padding: 13px 16px; font-size: 16px; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 12px; outline: none; font-family: inherit;
}
.ev-gate-card input:focus { border-color: var(--blue); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; font-size: 16px; font-weight: 600;
  border: none; border-radius: 12px; cursor: pointer; text-decoration: none;
  background: var(--blue); color: var(--white); transition: opacity .15s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: none; border: none; color: var(--muted); font-size: 13px; margin-top: 10px; cursor: pointer; }
.ev-error { color: var(--error); font-size: 14px; margin-top: 10px; }
.iab-note {
  margin-top: 14px; font-size: 12.5px; line-height: 1.55; color: #92400E;
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px;
  padding: 10px 12px; text-align: left;
}

/* ===== Page événement ===== */
.ev-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248,250,252,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: 14px 16px;
}
.ev-header-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ev-header .logo { font-size: 18px; font-weight: 800; color: var(--blue); text-decoration: none; }
.ev-header h1 { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-header .ev-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ev-header-inner { position: relative; }
.ev-user {
  display: inline-flex; align-items: center; gap: 7px; max-width: 210px;
  background: var(--white); border: 1px solid var(--border); border-radius: 100px;
  padding: 4px 10px 4px 4px; cursor: pointer; font-size: 12px; color: var(--muted);
}
.ev-user-initial {
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue);
  color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ev-user-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12); padding: 12px; min-width: 220px;
}
.ev-user-email { font-size: 13px; color: var(--muted); margin-bottom: 10px; word-break: break-all; }
.ev-logout {
  width: 100%; padding: 9px 12px; border: 1px solid #FECACA; border-radius: 9px;
  background: #FEF2F2; color: #B91C1C; font-size: 13px; font-weight: 600; cursor: pointer;
}
@media (max-width: 520px) {
  .ev-user-label { display: none; }
  .ev-user { padding: 4px; }
  .ev-header .ev-date { display: none; }
}

.ev-main { max-width: 680px; margin: 0 auto; padding: 20px 16px 120px; }

.ev-participants { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.ev-avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.ev-participants .count { font-size: 13px; color: var(--muted); margin-left: 4px; }

.ev-cat { margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.ev-cat-dot { width: 10px; height: 10px; border-radius: 3px; }
.ev-cat h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.task-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; margin-bottom: 12px;
}
.task-head { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.task-head .task-titles { flex: 1; min-width: 0; }
.task-head h3 { font-size: 16px; font-weight: 700; }
.task-head .task-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.task-chip {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 100px; white-space: nowrap;
}
.task-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.task-locked { font-size: 12px; color: var(--warning); margin-top: 8px; font-weight: 600; }

.task-body { margin-top: 14px; }
.opt {
  position: relative; display: block; width: 100%; text-align: left;
  border: 1.5px solid var(--border); background: var(--bg); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-size: 15px;
  transition: border-color .12s;
}
.opt:hover:not(:disabled) { border-color: var(--tc, var(--blue)); }
.opt.selected { border-color: var(--tc, var(--blue)); background: var(--tc-soft, #EFF6FF); }
.opt:disabled { opacity: .55; cursor: default; }
.opt .opt-label { font-weight: 600; display: block; padding-right: 70px; }
.opt .opt-count { position: absolute; right: 14px; top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.opt .opt-bar { height: 4px; border-radius: 2px; background: var(--border); margin-top: 8px; overflow: hidden; }
.opt .opt-bar i { display: block; height: 100%; background: var(--tc, var(--blue)); border-radius: 2px; }

/* validation */
.val-row { display: flex; gap: 8px; margin-top: 10px; }
.val-btn {
  flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 14px; font-weight: 600; cursor: pointer;
}
.val-btn.approve.selected { border-color: var(--success); background: #ECFDF5; color: #065F46; }
.val-btn.neutral.selected { border-color: var(--muted); background: #F1F5F9; }
.val-btn.reject.selected { border-color: var(--error); background: #FEF2F2; color: #991B1B; }
.val-counts { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* rating */
.stars { display: flex; gap: 4px; margin-top: 8px; }
.star { font-size: 26px; background: none; border: none; cursor: pointer; color: #CBD5E1; padding: 2px; }
.star.on { color: var(--warning); }
.rating-avg { font-size: 13px; color: var(--muted); margin-left: 8px; align-self: center; }

/* ranking */
.rank-hint { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; margin-right: 10px;
  background: var(--border); color: var(--muted); font-size: 13px; font-weight: 700;
  vertical-align: middle;
}
.rank-badge.on { background: var(--tc, var(--blue)); color: #fff; }
.opt-label--rank { display: inline; padding-right: 0; vertical-align: middle; }
.opt .opt-label.opt-label--rank { padding-right: 70px; display: inline-block; max-width: calc(100% - 40px); }
.rank-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.rank-actions .btn { width: auto; padding: 11px 18px; font-size: 14px; background: var(--tc, var(--blue)); }
.rank-actions .btn-ghost { margin-top: 0; width: auto; }

.readonly-note {
  font-size: 13px; color: var(--muted); background: var(--bg);
  border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}

.voted-note { font-size: 13px; color: var(--tc, var(--success)); font-weight: 600; margin-top: 8px; }

/* CTA app */
.ev-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.ev-cta-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ev-cta .txt { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.ev-cta .txt strong { color: var(--text); }
.ev-cta .btn { width: auto; padding: 10px 18px; font-size: 14px; flex-shrink: 0; white-space: nowrap; }

/* Modal création de compte */
.acct-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.acct-modal {
  background: var(--white); border-radius: 20px; padding: 28px 24px;
  max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.acct-modal h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.acct-modal .hint { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 18px; }
.acct-modal input {
  width: 100%; padding: 12px 14px; font-size: 15px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; outline: none; font-family: inherit;
}
.acct-modal input:focus { border-color: var(--blue); }
.btn-google { background: var(--text); }
.acct-sep {
  text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0;
  display: flex; align-items: center; gap: 10px;
}
.acct-sep::before, .acct-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.acct-modal .btn-ghost { width: 100%; }
.acct-modal .acct-switch { color: var(--blue); font-weight: 600; margin-top: 14px; }

.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 14px; padding: 10px 18px;
  border-radius: 100px; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }
