/* ------------------------------
   Reset & base
------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-body: #f4f5f7;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-footer: #ffffff;
  --bg-nav: #ffffff;

  --border-subtle: #e1e4ea;

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-invert: #ffffff;

  --primary: #2563eb;     /* bleu pro */
  --primary-soft: #dbeafe;
  --primary-strong: #1d4ed8;

  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --success: #16a34a;
  --success-soft: #dcfce7;

  --badge-muted-bg: #e5e7eb;
  --badge-muted-text: #4b5563;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);

  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  --transition-fast: 0.15s ease-out;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  background: radial-gradient(circle at top, #ffffff 0, #f4f5f7 55%, #e5e7eb 100%);
}

/* ------------------------------
   App shell
------------------------------ */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.app-header-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.75rem 4rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------
   Top nav (desktop / tablette)
------------------------------ */

.app-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  margin-bottom: 0.5rem;
}

.app-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-muted);
  white-space: nowrap;
  background: transparent;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.app-nav a:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.app-nav a.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
  font-weight: 600;
}

/* ------------------------------
   Bottom nav (mobile)
------------------------------ */

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.25rem;
  transition: color var(--transition-fast);
}

.bottom-nav a span {
  display: block;
  width: 18px;
  height: 3px;
  margin: 0 auto 0.2rem;
  border-radius: 999px;
  background: transparent;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.bottom-nav a.active span {
  background: var(--primary);
  transform: scaleX(1.4);
}

.bottom-nav a.active {
  color: var(--primary-strong);
  font-weight: 600;
}

/* Sur écran large, on garde quand même le bottom nav pour le côté webapp,
   mais tu peux le cacher si tu préfères via un media query. */

/* ------------------------------
   Footer
------------------------------ */

.app-footer {
  padding: 0.75rem 1rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
}

/* ------------------------------
   Cards
------------------------------ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-spaced {
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.card-header .form-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}


.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.card-text {
  font-size: 0.9rem;
  color: var(--text-main);
  margin: 0.25rem 0;
}

.card-logo {
  margin: 0.5rem 0;
}

.card-logo img {
  display: block;
  max-width: 80px;
  max-height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

/* Grid de cards */

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------
   Boutons
------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.85rem 0.95rem;
  font-size: 1.2rem;
  font-weight: 500;
  background: var(--primary);
  color: var(--text-invert);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn:hover {
  background: var(--primary-strong);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.btn.secondary {
  background: #ffffff;
  color: var(--primary-strong);
  border-color: var(--primary-soft);
}

.btn.secondary:hover {
  background: var(--primary-soft);
}

.btn.danger {
  background: #fde2e2;          
  border-color: #f5bcbc;
  color: #b91c1c;
}

.btn.danger:hover {
  background: #fbd0d0;
}

.btn.danger-outline {
  background: #ffffff;
  border: 1px solid #ef4444;   /* rouge vif mais fin */
  color: #b91c1c;
}

.btn.danger-outline:hover {
  background: #fee2e2;        /* léger rouge pastel au hover */
}

.btn.success {
  background: #d9f7e3;      
  border-color: #a2d9b5;
  color: #166534;           
}
.btn.success:hover {
  background: #c9f1d8;
}


/* ------------------------------
   Badges
------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge.success {
  background: var(--success-soft);
  color: #15803d;
}

.badge.danger {
  background: var(--danger-soft);
  color: #b91c1c;
}

.badge.muted {
  background: var(--badge-muted-bg);
  color: var(--badge-muted-text);
}

/* ------------------------------
   Formulaires
------------------------------ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.form-grid.two {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.01em;
}


input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="file"],
select,
textarea {
  border-radius: var(--radius-md);
  border: 1px solid #cbd5f5; /* un peu plus marqué que var(--border-subtle) */
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #f9fafb; /* léger gris pour bien découper le champ */
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
  background-color: #ffffff;
  transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
  font-size: 0.85rem;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
}

/* Actions boutons dans les formulaires */

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.form-inline {
  display: inline-block;
  margin: 0;
}

/* Toolbar de filtres */

.toolbar-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .toolbar-group {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ------------------------------
   Tableaux
------------------------------ */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

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

.table th,
.table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.table th {
  font-weight: 600;
  font-size: 0.8rem;
  color: #ffffff;
  background: #bc0000;
}

.table tr:hover td {
  background: #f9fafb;
}

.table-col-actions {
  width: 230px;
}

/* ------------------------------
   Alertes
------------------------------ */

.alert {
  border-radius: var(--radius-md);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.alert.error {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert.success {
  background: var(--success-soft);
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ------------------------------
   Page d’authentification
------------------------------ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.75rem;
  background: radial-gradient(circle at top, #e0edff 0, #f4f5f7 60%, #e5e7eb 100%);
}

.auth-card {
  max-width: 420px;
  width: 100%;
}

/* ------------------------------
   Utilitaires
------------------------------ */

p {
  margin: 0.2rem 0 0.4rem;
}

a {
  color: var(--primary-strong);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* On évite que le contenu passe sous la bottom-nav */
@media (max-width: 900px) {
  .app-main {
    padding-bottom: 4.5rem;
  }
}

/* ------------------------------
   Modals (popup / overlay)
------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.modal-dialog {
  position: relative;
  z-index: 41;
  max-width: 700px;
  width: 100%;
  padding: 0.75rem;
}

.modal-dialog-narrow {
  max-width: 520px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.card-actions form {
  margin: 0;
  padding: 0;
}

/* ------------------------------
   Fiche détail joueur
------------------------------ */

.player-details-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Ligne du haut : photo + infos droites */
.player-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: nowrap;          /* important : reste sur une ligne même sur mobile */
}

/* Photo carrée, un peu plus petite */
.player-photo-small {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-photo-small img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop carré */
}

.player-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #6b7280;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

/* Colonne droite */
.player-main-right {
  flex: 1;
  min-width: 0;              /* permet au texte de rétrécir sur mobile */
}

.player-name {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.player-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.player-line {
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

/* Infos sous la photo */
.player-extra-full {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.player-info-row {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.player-info-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.player-info-value a {
  color: var(--primary-strong);
  text-decoration: none;
}

.player-info-value a:hover {
  text-decoration: underline;
}

/* Bouton modifier centré */
.player-edit-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
}

/* Bouton retour sous le bloc */
.page-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-start;
}

/* Petit ajustement pour les très petits écrans */
@media (max-width: 400px) {
  .player-photo-small {
    width: 80px;
    height: 80px;
  }
  .player-name {
    font-size: 1.1rem;
  }
}

.flag-icon {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

/* Scroll vertical dans les formulaires de modale (parcours, etc.) */
.modal-body-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

/* Tableau des trous dans la modale parcours */
.holes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.holes-table th,
.holes-table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
}

.holes-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.holes-table input {
    width: 100%;
}

/* Layout spécifique Squads */
.layout-squads {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .layout-squads {
        grid-template-columns: 1fr;
    }
}

.card-squads-column .card-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 0.5rem;
}

.card-squads-column .card-title {
    font-size: 1rem;
}

.card-squads-column .card-subtitle {
    font-size: 0.85rem;
}

/* Colonnes scrollables (même esprit que modal-body-scroll) */
.card-body.scroll-column {
    max-height: 420px;
    overflow-y: auto;
}

/* Liste des joueurs disponibles */
.players-list {
    margin-top: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    max-height: 320px;
    overflow-y: auto;
    padding: 0.35rem 0;
    background: #fff;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.player-row input[type="checkbox"] {
    margin-right: 0.35rem;
}

.player-row:hover {
    background: rgba(59, 130, 246, 0.06);
}

.player-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.player-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: rgba(148, 163, 184, 0.25);
    color: #475569;
}

/* Séparateur discret dans les cards */
.card-separator {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    margin: 1rem 0;
}

/* Liste des squads */
.squads-list-grid {
    display: grid;
    gap: 0.75rem;
}

.squad-card-mini {
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.6rem 0.75rem 0.8rem;
    background: #fff;
}

.squad-card-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

.squad-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

.squad-meta {
    font-size: 0.78rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

/* Liste simple des joueurs dans une squad */
.simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.simple-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.88rem;
}

.simple-list-item + .simple-list-item {
    border-top: 1px dashed rgba(148, 163, 184, 0.4);
    margin-top: 0.15rem;
    padding-top: 0.35rem;
}

.squad-meta-form {
    margin-top: 0.5rem;
}


/* Espacements spécifiques à la modale Étapes */
#modal-etape-form .card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;              /* espace entre chaque bloc du formulaire */
}

#modal-etape-form .card-footer {
    margin-top: 0.75rem;    /* décoller les boutons du contenu */
}

/* Un petit poil d'air au-dessus de la case "Étape active" */
#modal-etape-form .form-field:last-of-type {
    margin-top: 0.5rem;
}

/* Scroll sur toute la modale Étape */
#modal-etape-form .modal-dialog {
    max-height: 90vh;                /* ne dépasse pas la hauteur de l'écran */
    display: flex;
    align-items: center;
}

#modal-etape-form .card {
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;                /* 👉 scroll sur toute la carte */
    -webkit-overflow-scrolling: touch;
}

/* Le footer reste visible en bas */
#modal-etape-form .card-footer {
    flex-shrink: 0;
}

/* Liste des joueurs dans la modale Étape */
#modal-etape-form .players-list {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #f5f5f7;
    /* pas de max-height / overflow ici -> un seul scroll global */
}

#modal-etape-form .player-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

#modal-etape-form .player-item input[type="checkbox"] {
    transform: scale(1.1);
}

#modal-etape-form .player-name {
    flex: 1;
}

#modal-etape-form #etape-joueurs-search {
    margin-bottom: 0.5rem;
}

/* ------------------------------
   Page Classement live
------------------------------ */

.page-live .app-header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.page-live .app-header-title,
.page-live .app-header-subtitle {
  text-align: center;
}

/* Carte infos étape */

.page-live #etape-info-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-live #etape-info-card .card-title {
  text-align: center;
  margin-bottom: 0.25rem;
}

.page-live #etape-info-card .etape-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.page-live #etape-details {
  font-size: 0.9rem;
}

.page-live #etape-details > div + div {
  margin-top: 0.15rem;
}

.page-live #etape-info-card .etape-update {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 140px;
}

/* Responsive : mobile */
@media (max-width: 640px) {
  .page-live #etape-info-card .etape-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .page-live #etape-info-card .etape-update {
    justify-content: center;
  }
}

/* Centrage des valeurs dans le tableau de classement */

.page-live #classement-table th,
.page-live #classement-table td {
  text-align: center;
}

/* Joueur aligné à gauche pour rester lisible */
.page-live #classement-table th:nth-child(2),
.page-live #classement-table td:nth-child(2) {
  text-align: left;
}

/* ------------------------------
   Page Classement live
------------------------------ */

.page-live .app-header {
  justify-content: center;
}

.page-live .app-header-main {
  text-align: center;
}

.page-live .app-header-title,
.page-live .app-header-subtitle {
  text-align: center;
  width: 100%;
}

/* Lien retour vers la saisie des scores */
.page-live .link-back-saisie {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}

.page-live .link-back-saisie:hover {
  text-decoration: underline;
}

/* Centrer les valeurs du tableau (sauf le nom pour la lisibilité) */
.page-live #classement-table th,
.page-live #classement-table td {
  text-align: center;
}

.page-live #classement-table th:nth-child(2),
.page-live #classement-table td:nth-child(2) {
  text-align: left;
}

/* Nom du joueur : version desktop vs mobile */
.player-name-mobile {
  display: none;
}

@media (max-width: 640px) {
  .player-name-desktop {
    display: none;
  }
  .player-name-mobile {
    display: inline;
  }
}

/* Masquer la colonne "Pen." dans le tableau du classement live */
.page-live #classement-table th:nth-child(5),
.page-live #classement-table td:nth-child(5) {
    display: none;
}

/* === Inscription étapes : switch Individuel / Double === */

.inscriptions-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-end;
}

.inscriptions-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.mode-switch {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem;
    border-radius: 999px;
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.mode-switch-btn {
    border: 0;
    background: transparent;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-switch-btn.is-active {
    background: var(--primary, #16a34a);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
}

.mode-panel {
    display: none;
    margin-top: 1rem;
}

.mode-panel.is-active {
    display: block;
}

@media (max-width: 640px) {
    .inscriptions-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mode-switch {
        width: 100%;
        justify-content: space-between;
    }

    .mode-switch-btn {
        flex: 1 1 0;
        text-align: center;
    }
}

.classement-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.classement-filters label {
    font-weight: 500;
}

.classement-filters select {
    min-width: 180px;
}

/* Overlay de chargement sur validation */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65); /* fond sombre transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.loading-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-overlay-content {
    background: #ffffff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.35);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    max-width: 320px;
}

.loading-overlay-content h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.loading-overlay-content p {
    margin: 0;
    font-size: 14px;
    color: #4b5563;
}

/* petit spinner */
.loading-spinner {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 3px solid #e5e7eb;
    border-top-color: #0f766e;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ------------------------------
   Page Inscription joueur
------------------------------ */

/* Wrapper global de la page d'inscription */
.signup-page .app-main {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding-top: 1.5rem;
}

/* Bandeau titre + texte d'intro */
.signup-hero {
  margin-bottom: 1rem;
  text-align: center;
}

.signup-hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.signup-hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Carte principale du formulaire d'inscription */
.card.signup-card {
  border-width: 2px;
  border-color: rgba(37, 99, 235, 0.18); /* léger accent bleu */
  background: radial-gradient(circle at top left, #eff6ff 0, #ffffff 55%);
  padding: 1.1rem 1.2rem;
}

/* Titre / sous-titre de la carte */
.signup-card-header {
  margin-bottom: 0.75rem;
}

.signup-card-header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.signup-card-header-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Découpage du formulaire en sections lisibles */
.signup-section {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #eeeeee;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.signup-section + .signup-section {
  margin-top: 0.65rem;
}

.signup-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4b5563;
  margin-bottom: 0.4rem;
}

/* Champs dans les sections */
.signup-section .form-grid {
  gap: 0.6rem;
}

/* Zone consentement / RGPD */
.signup-consent {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  font-size: 0.8rem;
  color: #166534;
}

/* Bouton de validation bien mis en avant */
.signup-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.signup-actions .btn {
  min-width: 200px;
  font-size: 1.2rem;
}

/* Message d'erreur / succès centré sous le titre */
.signup-messages {
  margin-bottom: 0.5rem;
}

.signup-messages .alert {
  margin-bottom: 0.4rem;
}

/* Sur mobile, on garde la lisibilité */
@media (max-width: 640px) {
  .signup-page .app-main {
    padding: 1rem 0.75rem 4.5rem;
  }

  .card.signup-card {
    padding: 0.9rem 0.9rem 1rem;
  }

  .signup-section {
    padding: 0.65rem 0.7rem;
  }
}

.signup-existing {
  margin: 0 0 0.9rem;
  display: flex;
  justify-content: center;
}

/* Bouton "Me connecter" version outline */
.btn.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-weight: 600;
}

.btn.btn-outline:hover {
  background-color: rgba(37, 99, 235, 0.06);
  color: var(--primary);
}

/* Filtres catégories en boutons */
.classement-filters-label {
  font-weight: 500;
}

.categorie-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cat-btn {
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: #ffffff;
  color: var(--primary-strong);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.cat-btn:hover {
  background: rgba(37, 99, 235, 0.06);
  transform: translateY(-1px);
}

.cat-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}
.modal-loading{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal-loading.is-open{ display: block; }

.modal-loading__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.modal-loading__content{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 360px);
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  text-align: center;
}

.modal-loading__title{
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 4px;
}

.modal-loading__text{
  font-size: 14px;
  opacity: .85;
}

.modal-loading__spinner{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,.12);
  border-top-color: rgba(0,0,0,.65);
  margin: 0 auto;
  animation: spin 0.9s linear infinite;
}

@keyframes spin{ to { transform: rotate(360deg); } }

/* =========================================================
   TAB BAR (footer style appli smartphone) - PUBLIC PAGES
   ========================================================= */

/* Empêche le contenu de passer sous la barre
   -> Mets .app-main sur ton wrapper principal (ou body si tu n'en as pas)
*/
.app-main{
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

/* Si tu n'as pas de wrapper .app-main, fallback */
body{
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

.app-tabbar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  height: 68px;
  padding-bottom: env(safe-area-inset-bottom);

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;

  background: rgba(15,23,42,.92);
  border-top: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 -10px 26px rgba(2,6,23,.18);
}

.app-tabbar__item{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  text-decoration: none;
  color: rgba(255,255,255,.85);
  font-weight: 600;
  font-size: 12px;

  transition: transform .12s ease, background .12s ease, color .12s ease;
}

.app-tabbar__item:active{
  transform: scale(.98);
}

.app-tabbar__icon{
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.app-tabbar__icon svg{
  width: 22px;
  height: 22px;
  color: currentColor;
}

.app-tabbar__label{
  line-height: 1;
}

.app-tabbar__item.is-active{
  color: #ffffff;
  background: rgba(255,255,255,.12);
}

.app-tabbar__item + .app-tabbar__item{
  box-shadow: -1px 0 0 rgba(255,255,255,.14);
}

/* =========================================================
   PUBLIC HEADER (réutilisable)
   ========================================================= */

.public-header{
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(2, 6, 23, .08);
}

.public-header__inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 14px;
}

.public-header__brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.public-header__logo{
  width: 46px;   /* logo un peu plus grand */
  height: 46px;
  object-fit: contain;
}

.public-header__title{
  font-weight: 800;
  font-size: 18px; /* texte assez gros */
  letter-spacing: .2px;
}

/* Responsive : sur très petit écran, on garde lisible */
@media (max-width: 420px){
  .public-header__logo{ width: 42px; height: 42px; }
  .public-header__title{ font-size: 16px; }
}

