@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0c1626;
  --bg-panel: #142137;
  --bg-panel-2: #1a2b47;
  --line: #2b3c5c;
  --gold: #f2b134;
  --gold-dim: #b8862a;
  --pink: #ef476f;
  --text: #f7f4ef;
  --text-muted: #93a2c0;
  --success: #3ecf8e;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Bruit de fond subtil + halo de scène */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(242,177,52,0.18), transparent 60%),
    radial-gradient(ellipse 50% 30% at 90% 100%, rgba(239,71,111,0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, .display {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

a { color: inherit; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------- Header / hero ---------- */
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.brand-row img {
  height: 44px;
  width: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  padding: 3px;
}
.brand-row .brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--text);
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 26px;
}
.photo-strip img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.photo-strip-caption {
  color: var(--text-muted);
  font-size: 11.5px;
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 26px;
  margin-bottom: 14px;
}
.eq span {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--pink));
  animation: bounce 1.1s ease-in-out infinite;
}
.eq span:nth-child(1){ height: 40%; animation-delay: 0s; }
.eq span:nth-child(2){ height: 90%; animation-delay: .12s; }
.eq span:nth-child(3){ height: 60%; animation-delay: .24s; }
.eq span:nth-child(4){ height: 100%; animation-delay: .36s; }
.eq span:nth-child(5){ height: 50%; animation-delay: .48s; }
.eq span:nth-child(6){ height: 75%; animation-delay: .6s; }
.eq span:nth-child(7){ height: 35%; animation-delay: .72s; }

@keyframes bounce {
  0%, 100% { transform: scaleY(0.4); opacity: .7; }
  50% { transform: scaleY(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .eq span { animation: none; }
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

h1.display {
  font-size: clamp(42px, 12vw, 64px);
  background: linear-gradient(90deg, #ffffff 0%, var(--gold) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 4px 0 6px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 46ch;
  margin-bottom: 28px;
}

/* ---------- Card / panel ---------- */
.panel {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.panel-title {
  font-size: 22px;
  margin-bottom: 4px;
}
.panel-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ---------- Form ---------- */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field label .req { color: var(--pink); }

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: 1fr; }
}

input[type=text],
input[type=tel],
input[type=email],
input[type=date],
select {
  width: 100%;
  background: #0f0c1a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
input:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242,177,52,0.18);
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a79fc0' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.file-drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: #0f0c1a;
  transition: border-color .15s ease, background .15s ease;
  position: relative;
}
.file-drop:hover { border-color: var(--gold-dim); }
.file-drop input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-drop .fd-title {
  font-weight: 700;
  font-size: 14px;
}
.file-drop .fd-sub {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 3px;
}
.file-preview {
  margin-top: 12px;
  display: none;
}
.file-preview img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.checkbox-row input { margin-top: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 18px;
  border-radius: var(--radius);
  border: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(90deg, var(--gold), #f5c563);
  color: #221a0a;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { border-color: var(--pink); }

.btn-whatsapp {
  background: #25D366;
  color: #06210f;
}

.btn-spacer { height: 10px; }

.error-text {
  color: var(--pink);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.helper-banner {
  background: rgba(242,177,52,0.1);
  border: 1px solid rgba(242,177,52,0.35);
  color: var(--gold);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

/* ---------- Payment page ---------- */
.matricule-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.08em;
  font-size: 20px;
  padding: 6px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 46px;
  color: var(--gold);
  margin: 6px 0 2px;
}

.momo-box {
  background: #0f0c1a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0;
}
.momo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.momo-row:last-child { border-bottom: none; }
.momo-row .k { color: var(--text-muted); }
.momo-row .v { font-weight: 700; }
.copy-btn {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  color: var(--gold);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 22px 0;
}
.divider-or::before, .divider-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* ---------- Confirmation page ---------- */
.status-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
}
.status-icon.paye { background: rgba(62,207,142,0.15); color: var(--success); }
.status-icon.attente { background: rgba(242,177,52,0.15); color: var(--gold); }

.qr-box {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
  margin: 14px 0;
}
.qr-box img { display: block; width: 160px; height: 160px; }

.center { text-align: center; }

footer.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 30px;
}

.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(0,0,0,0.25);
  border-top-color: #221a0a;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-panel {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---------- Admin dashboard ---------- */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.btn-logout {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-logout:hover { color: var(--pink); border-color: var(--pink); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.stat-card .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
}
.stat-card.stat-paye .num { color: var(--success); }
.stat-card.stat-attente .num { color: var(--pink); }
.stat-card .label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filters input[type=text] {
  flex: 1;
  min-width: 160px;
}
.filters select { width: auto; }

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.candidate-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color .15s ease;
}
.candidate-card:hover { border-color: var(--gold-dim); }
.candidate-card img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.candidate-info { flex: 1; min-width: 0; }
.candidate-name {
  font-weight: 800;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.candidate-meta {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 2px;
}
.candidate-matricule {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.candidate-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.btn-delete-row {
  background: transparent;
  border: 1px solid rgba(239,71,111,0.4);
  color: var(--pink);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.btn-delete-row:hover { background: rgba(239,71,111,0.12); }

/* ---------- Tableau récapitulatif ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}
table.recap-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 980px;
  font-size: 13px;
}
table.recap-table th {
  background: var(--bg-panel-2);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.recap-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
table.recap-table tbody tr:hover { background: rgba(242,177,52,0.05); }
table.recap-table td.nom-cell {
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
}
table.recap-table td.nom-cell:hover { text-decoration: underline; }

.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: inline-block;
}
.status-pill.paye { background: rgba(62,207,142,0.15); color: var(--success); }
.status-pill.non_paye { background: rgba(242,177,52,0.15); color: var(--gold); }
.status-pill.en_attente { background: rgba(147,162,192,0.15); color: var(--text-muted); }

/* ---------- Fiche candidat (détail) ---------- */
.back-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  cursor: pointer;
  background: none;
  border: none;
}
.back-link:hover { color: var(--gold); }

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.detail-photo {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.detail-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
@media (max-width: 420px) {
  .detail-fields { grid-template-columns: 1fr; }
}
.detail-field .k {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.detail-field .v {
  font-size: 15px;
  font-weight: 700;
}
.capture-thumb {
  width: 100%;
  max-width: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-top: 10px;
  display: block;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* ---------- Espace Jury ---------- */
.zone-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.zone-card .zone-name {
  font-weight: 800;
  font-size: 15px;
}
.zone-card select {
  width: auto;
  min-width: 180px;
}
.phase-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(242,177,52,0.15);
  color: var(--gold);
  white-space: nowrap;
}
.phase-badge.aucune {
  background: rgba(147,162,192,0.12);
  color: var(--text-muted);
}

.jury-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.jury-card .jury-name { font-weight: 700; font-size: 14px; }
.jury-card .jury-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f0c1a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
}
.checkbox-grid input { margin: 0; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--gold); border-color: var(--gold); }

.note-row {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.note-row img {
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.note-row .note-info { flex: 1; min-width: 0; }
.note-row .note-name { font-weight: 700; font-size: 14px; }
.note-row .note-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.note-input-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.note-input-wrap input {
  width: 56px;
  text-align: center;
  padding: 9px 4px;
}
.note-saved-tag {
  font-size: 11px;
  color: var(--success);
  font-weight: 700;
  white-space: nowrap;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-panel-2);
  color: var(--gold);
  font-weight: 800;
  font-size: 12.5px;
}
.rank-badge.top1 { background: var(--gold); color: #221a0a; }
.rank-badge.top2 { background: #cfd4dd; color: #1a1a1a; }
.rank-badge.top3 { background: #c98a4b; color: #221a0a; }

.moyenne-cell {
  font-weight: 800;
  color: var(--gold);
}

/* ---------- CMS Site vitrine ---------- */
.cms-item-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cms-item-card img {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.cms-item-info { flex: 1; min-width: 0; }
.cms-item-title { font-weight: 700; font-size: 14px; }
.cms-item-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.cms-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-mini {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-mini:hover { border-color: var(--gold); color: var(--gold); }
.btn-mini.danger:hover { border-color: var(--pink); color: var(--pink); }
.btn-mini.active-state { border-color: var(--success); color: var(--success); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gallery-grid .gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.gallery-grid .gallery-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.gallery-grid .gallery-item .gallery-cat {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(8,9,12,0.75);
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 8px;
}
.gallery-grid .gallery-item .gallery-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(8,9,12,0.75);
  color: var(--pink);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
}
.gallery-grid .gallery-item .gallery-check {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--gold);
}
.gallery-grid .gallery-item.selected {
  outline: 2px solid var(--gold);
}
