:root {
  --bleu-fonce: #073b6f;
  --bleu: #0a6bb0;
  --bleu-clair: #4fb3e8;
  --accent: #00c2a8;
  --gris-fond: #f2f6fa;
  --gris-texte: #33414f;
  --blanc: #ffffff;
  --rouge: #d5453b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--gris-fond);
  color: var(--gris-texte);
}

.hero {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff8d6;
  border-bottom: 4px solid var(--accent);
  color: var(--bleu-fonce);
  padding: 48px 20px;
  text-align: center;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero h1 { margin: 0 0 8px; font-size: 2.2rem; color: var(--bleu-fonce); }
.hero .subtitle { margin: 0; opacity: 0.85; font-size: 1.05rem; color: var(--gris-texte); }

.hero-logos {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 0;
  pointer-events: none;
}

.hero-logos img {
  height: 90px;
  width: auto;
  opacity: 0.8;
}

.hero-logos img:nth-child(2) {
  margin-left: auto;
  margin-right: 32px;
}

@media (max-width: 560px) {
  .hero-logos img:nth-child(2) { margin-right: 18px; }
}

@media (max-width: 560px) {
  .hero-logos { padding: 0 12px; }
  .hero-logos img { height: 50px; }
}

.container {
  max-width: 760px;
  margin: -30px auto 40px;
  padding: 0 16px;
}

.card {
  background: var(--blanc);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(7, 59, 111, 0.12);
  padding: 28px 28px 32px;
  margin-bottom: 24px;
}

.card-summary {
  cursor: pointer;
  list-style: none;
  color: var(--bleu-fonce);
}

.card-summary::-webkit-details-marker {
  display: none;
}

.card-summary::before {
  content: '▶ ';
  font-size: 0.8em;
  margin-right: 4px;
}

details[open] > .card-summary::before {
  content: '▼ ';
}

details.card:not([open]) {
  padding-bottom: 28px;
}

.card h2 { margin-top: 0; color: var(--bleu-fonce); }

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.form-header h2 { margin: 0; }

.role-toggle {
  display: flex;
  background: #eef4fa;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--bleu-fonce);
  margin-bottom: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.role-option input {
  width: auto;
  accent-color: var(--accent);
}

.role-option:has(input:checked) {
  background: var(--accent);
  color: var(--blanc);
}

@media (max-width: 560px) {
  .form-header { flex-direction: column; align-items: flex-start; }
  .role-toggle { align-self: stretch; justify-content: center; }
}

.hint { color: #667789; font-size: 0.9rem; }
.req { color: var(--rouge); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.field { margin-bottom: 16px; display: flex; flex-direction: column; }

label { font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }

input, select, textarea {
  padding: 10px 12px;
  border: 1px solid #cfd9e3;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--blanc);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bleu);
  box-shadow: 0 0 0 3px rgba(10, 107, 176, 0.15);
}

.field-disabled {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.epreuves-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e8ef;
  border-radius: 8px;
  background: #f9fbfd;
}

@media (max-width: 560px) {
  .epreuves-list { grid-template-columns: 1fr; }
}

.epreuve-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.epreuve-item input { width: auto; }

.btn-primary, .btn-secondary {
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--blanc);
  width: 100%;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.99); }

.btn-secondary {
  background: var(--bleu);
  color: var(--blanc);
}

.message { margin-top: 12px; font-weight: 600; }
.message.error { color: var(--rouge); }
.message.ok { color: #1f8a4c; }

.success-card { text-align: center; }
.success-card h2 { color: #1f8a4c; }

footer {
  text-align: center;
  padding: 24px;
  color: #7a8a99;
  font-size: 0.85rem;
}

footer a { color: var(--bleu); }

.signature {
  color: var(--rouge);
  font-weight: 700;
  text-align: center;
  margin-top: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--bleu-fonce);
  text-decoration: none;
  background: var(--blanc);
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(7, 59, 111, 0.1);
}

.back-link:hover {
  background: #eef4fa;
}

/* Admin */
.admin-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e6ecf1;
}

th { background: #eef4fa; color: var(--bleu-fonce); }

tr:hover td { background: #f6fafd; }

.badge {
  display: inline-block;
  background: #e6f7f3;
  color: #0b8f77;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.78rem;
  margin: 2px;
}

.btn-danger {
  background: var(--rouge);
  color: var(--blanc);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.8rem;
}

.epreuves-details summary {
  cursor: pointer;
  color: var(--bleu);
  font-weight: 600;
  font-size: 0.85rem;
  list-style: none;
}

.epreuves-details summary::-webkit-details-marker {
  display: none;
}

.epreuves-details summary::before {
  content: '▶ ';
  font-size: 0.7em;
}

.epreuves-details[open] summary::before {
  content: '▼ ';
}

.epreuves-details-content {
  margin-top: 6px;
}

.login-box {
  max-width: 360px;
  margin: 80px auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: #eef4fa;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-box.stat-juges {
  background: #fdead9;
}

.stat-box.stat-juges .stat-value {
  color: #b45309;
}

.stat-box.stat-concurrents {
  background: #dcf5ea;
}

.stat-box.stat-concurrents .stat-value {
  color: #0b8f57;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bleu-fonce);
}

.stat-label {
  font-size: 0.8rem;
  color: #667789;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th, .stats-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e6ecf1;
}

.stats-table th {
  background: #eef4fa;
  color: var(--bleu-fonce);
}

.epreuve-position {
  width: 58px;
  padding: 4px 6px;
  text-align: center;
  flex-shrink: 0;
}

/* ============================================================
   Panneau "Séries" (competition.html) — thème sombre dédié,
   scopé à .series-panel pour ne pas affecter le reste du site.
   ============================================================ */

.series-panel {
  background: #0f1b2d;
  color: #e6edf5;
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
}

.series-panel-card {
  background: #16253d;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.series-panel-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9fb3c8;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.series-panel .admin-toolbar {
  align-items: center;
}

.series-panel input[type="number"],
.series-panel select {
  background: #0f1b2d;
  border: 1px solid #2a3c56;
  color: #e6edf5;
  border-radius: 6px;
  padding: 8px 10px;
}

.btn-series {
  background: #1d3358;
  color: #e6edf5;
  border: 1px solid #2a3c56;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-series:hover { background: #24406b; }

.series-compteur {
  color: #9fb3c8;
  font-size: 0.85rem;
}

.series-plots-actifs {
  margin-left: auto;
  font-size: 0.8rem;
  color: #9fb3c8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-ligne-zero {
  background: #24406b;
  color: #e6edf5;
  border: 1px solid #2a3c56;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  cursor: pointer;
}

.badge-count {
  background: #d5453b;
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.75rem;
}

.binomes-liste { display: flex; flex-direction: column; gap: 6px; }

.binome-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1b2d;
  border: 1px solid #2a3c56;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.non-assignes-liste {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: #cddaea;
}

.non-assignes-groupe {
  margin-bottom: 10px;
}

.non-assignes-groupe:last-child {
  margin-bottom: 0;
}

.non-assignes-groupe-titre {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.non-assignes-groupe .non-assignes-liste {
  list-style: none;
  padding-left: 0;
}

.non-assignes-groupe .non-assignes-liste li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.numero-badge {
  display: inline-block;
  color: #0f1b2d;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.categorie-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.categorie-badge {
  color: #0f1b2d;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 3px 12px;
}

.series-panel-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.series-panel-left {
  flex: 0 0 340px;
  min-width: 0;
}

.series-colonnes {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .series-panel-row {
    flex-direction: column;
  }
  .series-panel-left {
    flex: 1 1 auto;
    width: 100%;
  }
}

.serie-colonne {
  background: #16253d;
  border-radius: 8px;
  width: 240px;
  flex-shrink: 0;
  max-height: min(60vh, 420px);
  display: flex;
  flex-direction: column;
}

.serie-colonne-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #2a3c56;
}

.serie-colonne-count {
  color: #9fb3c8;
  font-weight: 400;
  font-size: 0.8rem;
}

.serie-colonne-lignes {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ligne-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f1b2d;
  border: 1px solid #2a3c56;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.ligne-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1d3358;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.ligne-vide-label {
  color: #6b7c93;
  font-style: italic;
  flex: 1;
}

.ligne-occupant {
  flex: 1;
  font-weight: 600;
}

.ligne-occupee {
  border-color: #2f6b4f;
  background: #10241a;
  cursor: grab;
}

.ligne-row.dragging {
  opacity: 0.4;
}

.ligne-row.drop-cible {
  border-color: var(--accent, #00c2a8);
  box-shadow: 0 0 0 2px rgba(0, 194, 168, 0.4);
}

.non-assignes-groupe .non-assignes-liste li {
  cursor: grab;
}

.non-assignes-liste.drop-cible,
[data-drop-bench].drop-cible {
  outline: 2px dashed var(--accent, #00c2a8);
  outline-offset: 4px;
  border-radius: 6px;
}

.ligne-retirer {
  background: none;
  border: none;
  color: #9fb3c8;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

.ligne-retirer:hover { color: #d5453b; }

.ligne-desactivee {
  opacity: 0.5;
  cursor: default;
  background: transparent;
}

.ligne-select-occupant {
  flex: 1;
  width: 100%;
}

@media (max-width: 560px) {
  .series-plots-actifs { margin-left: 0; }
  .serie-colonne { width: 100%; max-width: 260px; }
}
