/* Police "Heebo" (Regular/Black) — charte graphique LFPL, section Typos.
   @import plutôt qu'un <link> par page : un seul point de modification pour
   tout le site plutôt que de toucher chaque gabarit PHP. */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;900&display=swap');

:root {
  /* Charte graphique officielle LFPL (Charte graphique LFPL.pdf, section
     "Couleurs & références") — remplace les teintes approximatives utilisées
     avant l'obtention du document officiel. */
  --fff-blue: #2D427B;        /* Bleu foncé (officiel) */
  --fff-blue-700: #202F58;    /* dérivé (assombri ~28%) pour les états hover/pressed — pas de teinte plus sombre dans la charte */
  --fff-blue-mid: #325491;    /* Bleu (officiel) — accents secondaires */
  --fff-blue-light: #416EA9;  /* Bleu clair (officiel) — accents/liens sur fond sombre */
  --fff-red: #D8171C;         /* Rouge (officiel) */
  --fff-gold: #C19A2A;        /* Doré (officiel) */
  --bg: #F4F6F9;
  --white: #FFFFFF;
  --text: #14172B;
  --muted: #55607A;          /* 5.6:1 sur blanc — AA */
  --border: #D4D8E2;
  --star-on: #F5C518;        /* volontairement distinct du doré officiel : le doré (#C19A2A) est trop peu contrasté pour rester lisible en glyphe d'étoile sur fond clair */
  --ok: #147a4e;
  --ring: #5271FF;           /* Bleu vif (officiel) — anneau de focus visible */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.10);
  --shadow: 0 4px 16px rgba(16,24,40,0.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,0.14);

  /* Échelle BMF : 1 = meilleur (vert) ... 5 = pire (rouge), reprise de N1.html */
  --score-1: #27ae60;
  --score-2: #2ecc71;
  --score-3: #f1c40f;
  --score-4: #e67e22;
  --score-5: #e74c3c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; color-scheme: light; scroll-behavior: smooth; }

body {
  font-family: 'Heebo', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  padding-bottom: 48px;
  -webkit-font-smoothing: antialiased;
}

/* --- Focus visible universel (accessibilité clavier) --- */
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* --- Lien d'évitement (skip link) --- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--white); color: var(--fff-blue); font-weight: 700;
  padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: top 0.18s ease;
}
.skip-link:focus { top: 12px; }

/* --- Bannière (masthead) --- */
/* Hauteur fixe, image jamais déformée (object-fit: contain), fond bleu
   proche de la couleur de la bannière pour combler les côtés sans bande blanche visible. */
.banner-wrap {
  width: 100%;
  height: 140px;              /* ≈ 5 cm à densité d'écran standard (96 dpi) */
  background: #041d3c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.site-banner { display: block; height: 100%; width: 100%; object-fit: contain; }

@media (max-width: 640px) {
  .banner-wrap { height: 90px; }
}

/* --- En-tête --- */
.app-header {
  background: var(--fff-blue); color: white;
  padding: 11px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,50,0.22);
}
.fff-badge { width: 42px; height: 42px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fff-badge svg { width: 32px; height: 32px; }
.app-header h1 { font-size: 15px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.3; flex: 1; }
.app-header h1 span { display: block; font-size: 11px; font-weight: 400; opacity: 0.78; text-transform: none; letter-spacing: 0; margin-top: 2px; }
.header-link {
  color: white; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.34);
  border-radius: 22px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.15s;
}
.icon { flex-shrink: 0; }
.btn .icon { margin-top: -1px; }
.header-link:hover { background: rgba(255,255,255,0.28); }

.container { max-width: 960px; margin: 0 auto; padding: 22px 16px; }

/* --- Alertes --- */
.alert { border-radius: var(--radius-sm); padding: 13px 16px; font-size: 15px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.alert::before { font-size: 18px; line-height: 1; }
.alert-success { background: #E4F5EC; color: var(--ok); border: 1px solid #B6E3CA; }
.alert-success::before { content: '✓'; }
.alert-error { background: #FDE7E9; color: #C81E27; border: 1px solid #F6B8BE; }
.alert-error::before { content: '⚠'; }

/* --- Carte identité --- */
.identity-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; border-top: 4px solid var(--fff-gold); }
.identity-card h2 { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fff-blue); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.identity-card h2::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--fff-gold); border-radius: 2px; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group.full { grid-column: 1 / -1; }
.field-group label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Champs : 16px pour éviter le zoom auto iOS, min 44px de haut */
.field-group input, .field-group select,
.filter-field input, .filter-field select,
.comment-area textarea, .synthese-textarea, .sg-comment textarea {
  font-size: 16px; font-family: inherit; color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); width: 100%; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field-group input, .field-group select,
.filter-field input, .filter-field select { min-height: 46px; padding: 10px 12px; }
.field-group input:focus, .field-group select:focus,
.filter-field input:focus, .filter-field select:focus,
.comment-area textarea:focus, .synthese-textarea:focus, .sg-comment textarea:focus {
  border-color: var(--fff-blue); background: white; box-shadow: 0 0 0 3px rgba(0,48,135,0.14);
}
.field-group select:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Sections d'évaluation --- */
/* --- Brouillon local (sauvegarde auto + reprise de saisie) --- */
.draft-status { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 14px; min-height: 16px; opacity: 0; transition: opacity 0.3s ease; }
.draft-status.visible { opacity: 1; }
.draft-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #EEF2FB; border: 1px solid var(--border); border-left: 4px solid var(--fff-blue);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px; color: var(--text);
}
.draft-clear-btn { background: none; border: none; color: var(--fff-blue); font-weight: 700; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.draft-clear-btn:hover { color: var(--fff-blue-700); }

/* --- Progression + repli/dépli des sections (Séance & Match) --- */
.form-progress-wrap { margin-bottom: 18px; }
.form-progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.form-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--fff-blue), var(--fff-gold)); border-radius: 999px; transition: width 0.3s ease; }
.form-progress-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }

.eval-section { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.section-title { background: var(--fff-blue); color: white; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 13px 18px; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.section-title:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
.bilan-section .section-title { background: var(--fff-red); }
.section-counter { font-size: 11px; font-weight: 600; letter-spacing: normal; text-transform: none; opacity: 0.85; margin-left: auto; white-space: nowrap; }
.section-chevron { display: inline-block; font-size: 13px; transition: transform 0.2s ease; }
.eval-section.collapsed .section-chevron { transform: rotate(-90deg); }
.eval-section.collapsed > *:not(.section-title):not(.section-nav) { display: none; }
.section-nav { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; background: #FAFBFD; border-top: 1px solid var(--border); }
.section-nav:only-child { border-top: none; } /* section sans critère (ex: futur ajout) : pas de double bord */

.criteria-row { border-bottom: 1px solid var(--border); }
.criteria-row:last-of-type { border-bottom: none; }
.criteria-main { display: flex; align-items: center; padding: 14px 16px 14px 18px; gap: 14px; }
.criteria-text { flex: 1; font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.criteria-sub { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 3px; line-height: 1.45; }

.comment-area { padding: 0 18px 16px; display: none; }
.comment-area.visible { display: block; animation: reveal 0.2s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.comment-area textarea, .synthese-textarea, .sg-comment textarea { padding: 10px 12px; resize: vertical; min-height: 68px; }
.comment-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 6px; display: block; }

.synthese-row { background: #EEF2FB; border-top: 2px solid var(--border); padding: 13px 18px; display: flex; align-items: center; gap: 14px; }
.synthese-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fff-blue); flex: 1; }
.synthese-comment-wrap { padding: 10px 18px 16px; }

.synthese-generale { background: linear-gradient(135deg, var(--fff-blue), var(--fff-blue-700)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 24px; color: white; }
.synthese-generale h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px; opacity: 0.92; }
.sg-inner { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.sg-comment { flex: 1; min-width: 220px; }
.sg-comment label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.72); font-weight: 700; margin-bottom: 6px; }
.sg-comment textarea { background: rgba(255,255,255,0.95); }

/* --- Étoiles (radios accessibles, remplissage 1→N) --- */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.star-input label {
  font-size: 30px; line-height: 44px; min-width: 34px; text-align: center;
  color: var(--border); cursor: pointer;
  transition: color 0.12s, transform 0.08s;
}
.star-input label:active { transform: scale(0.82); }
.star-input input:checked ~ label { color: var(--star-on); }
.star-input:hover input ~ label { color: var(--border); }
.star-input label:hover, .star-input label:hover ~ label { color: #E6B800; }
.star-input input:focus-visible + label { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.sg-stars .star-input label { font-size: 36px; color: rgba(255,255,255,0.4); }
.sg-stars .star-input input:checked ~ label { color: var(--star-on); }
.sg-stars .star-input label:hover, .sg-stars .star-input label:hover ~ label { color: #FFD54A; }

/* --- Légende --- */
/* Fiche Match : réutilise .star-input/.stars-display (même échelle 1-5 que Séance). */

.legend-bar { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.legend-pill { display: flex; align-items: center; gap: 6px; background: white; border-radius: 22px; padding: 7px 13px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm); color: var(--muted); }
.legend-pill .stars { color: var(--star-on); font-size: 13px; letter-spacing: -1px; }

/* --- Boutons --- */
.btn {
  border-radius: var(--radius-sm); padding: 14px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; width: 100%; border: none; min-height: 48px;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--fff-blue); color: white; }
.btn-primary:hover { background: var(--fff-blue-700); }
.btn-secondary { background: white; color: var(--fff-blue); border: 2px solid var(--fff-blue); }
.btn-secondary:hover { background: #EEF2FB; }
.btn-danger { background: var(--fff-red); color: white; }
.btn-danger:hover { background: #cf1820; }
.btn-sm { padding: 10px 16px; font-size: 14px; width: auto; min-height: 44px; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

/* --- Lecture seule : étoiles affichées --- */
.stars-lit { color: var(--star-on); font-size: 16px; letter-spacing: 1px; }
.stars-off { color: var(--border); font-size: 16px; letter-spacing: 1px; }
.stars-label { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.stars-empty { font-size: 12.5px; color: var(--muted); font-style: italic; }

/* --- Barre d'outils admin --- */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-toolbar h2 { font-size: 20px; color: var(--fff-blue); }
.admin-toolbar .saison-badge { background: var(--fff-gold); color: var(--text); font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 22px; letter-spacing: 0.02em; } /* texte foncé : blanc sur doré échoue le contraste AA (2.65:1) */

/* --- Filtres --- */
.filter-bar { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field.grow { flex: 1; min-width: 200px; }
.filter-field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.filter-field select, .filter-field input { min-width: 160px; }
.filter-actions { display: flex; gap: 10px; align-items: center; }
.count-badge { background: rgba(255,255,255,0.24); border-radius: 12px; padding: 2px 10px; font-size: 12px; margin-left: 8px; font-variant-numeric: tabular-nums; }

/* --- Cartes de stats --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border-left: 4px solid var(--fff-blue); transition: transform 0.15s, box-shadow 0.15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--fff-blue); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-top: 10px; }

/* --- Panneaux --- */
.panel { background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.panel > h3 { background: var(--fff-blue); color: white; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 13px 18px; display: flex; align-items: center; }

.section-bars { padding: 18px; display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 56px; align-items: center; gap: 14px; }
.bar-row .bar-name { font-size: 14px; font-weight: 600; }
.bar-track { background: var(--bg); border-radius: 22px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--fff-blue), var(--fff-gold)); border-radius: 22px; transition: width 0.5s ease; }
.bar-row .bar-val { font-size: 14px; font-weight: 700; color: var(--fff-blue); text-align: right; font-variant-numeric: tabular-nums; }

/* --- Tableaux --- */
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th { background: var(--bg); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-align: left; padding: 11px 14px; font-weight: 700; }
table.data td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; }
table.data tbody tr { transition: background 0.12s; }
table.data tr:hover td { background: #F7F9FC; }
table.data a { color: var(--fff-blue); font-weight: 600; text-decoration: none; }
table.data a:hover { text-decoration: underline; }
.empty-state { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 15px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--fff-blue); font-size: 14px; font-weight: 600; text-decoration: none; min-height: 44px; }
.back-link:hover { text-decoration: underline; }

/* --- Détail fiche --- */
.detail-identity { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; padding: 18px; background: #EEF2FB; border-bottom: 3px solid var(--fff-gold); }
.detail-identity .id-field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.detail-identity .id-field p { font-size: 15px; font-weight: 600; margin-top: 3px; }
.detail-notes { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.detail-notes th { background: var(--fff-blue); color: white; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 11px 14px; text-align: left; }
.detail-notes td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.detail-notes .row-synthese td { background: #EEF2FB; font-weight: 700; }
.detail-notes .crit-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }

.fiche-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.profil-form select { min-height: 34px; padding: 5px 8px; font-size: 13px; border: 1.5px solid var(--border); border-radius: 6px; background: white; }
.inline-form { display: inline; margin: 0; }

/* --- Portail (hub post-connexion) --- */
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.portal-tile {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 20px;
  text-align: center; text-decoration: none; color: var(--text); border-top: 4px solid var(--fff-blue);
  transition: transform 0.15s, box-shadow 0.15s;
}
.portal-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.portal-tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #EEF2FB; color: var(--fff-blue); margin-bottom: 14px; }
.portal-tile-icon .icon { width: 26px; height: 26px; }
.portal-tile-title { font-size: 18px; font-weight: 800; color: var(--fff-blue); margin-bottom: 4px; }
.portal-tile-sub { font-size: 13px; color: var(--muted); }
.portal-tile-disabled { opacity: 0.55; cursor: not-allowed; border-top-color: var(--border); }
.portal-tile-disabled .portal-tile-icon { background: var(--bg); color: var(--muted); }
.portal-tile-disabled .portal-tile-title { color: var(--muted); }

/* Code couleur par module, cohérent avec le tableau de bord unifié. */
.portal-tile-bmf { border-top-color: var(--fff-gold); }
.portal-tile-bmf .portal-tile-icon { background: #FAF3E3; color: var(--fff-gold); }
.portal-tile-bmf .portal-tile-title { color: #a5883d; }

.portal-tile-dashboard {
  background: linear-gradient(135deg, var(--fff-blue), var(--fff-blue-700));
  border-top-color: var(--fff-gold);
}
.portal-tile-dashboard .portal-tile-icon { background: rgba(255,255,255,0.14); color: white; }
.portal-tile-dashboard .portal-tile-title { color: white; }
.portal-tile-dashboard .portal-tile-sub { color: rgba(255,255,255,0.72); }

/* --- Login --- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 20px; }

.login-stage {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 880px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: white;
  min-height: 480px;
}

/* --- Panneau visuel : terrain de football stylisé, animé --- */
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 32px 30px;
  background:
    radial-gradient(circle at 20% 15%, rgba(193,154,42,0.24), transparent 55%),
    linear-gradient(155deg, #16233f 0%, var(--fff-blue) 55%, var(--fff-blue-mid) 100%);
  color: white;
  isolation: isolate;
}

.pitch-pattern {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    100deg,
    rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 46px,
    rgba(255,255,255,0) 46px, rgba(255,255,255,0) 92px
  );
  z-index: 0;
}

.pitch-markings { position: absolute; inset: 0; z-index: 0; }
.pitch-halfway { position: absolute; left: 50%; top: 8%; bottom: 8%; width: 2px; background: rgba(255,255,255,0.16); transform: translateX(-50%); }
.pitch-circle {
  position: absolute; left: 50%; top: 50%; width: 130px; height: 130px;
  border: 2px solid rgba(255,255,255,0.16); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.pitch-corner { position: absolute; width: 60px; height: 60px; border: 2px solid rgba(255,255,255,0.14); border-radius: 50%; }
.pitch-corner-tl { top: -30px; left: -30px; }
.pitch-corner-br { bottom: -30px; right: -30px; }

.floodlight {
  position: absolute; top: -20%; right: -10%; width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(193,154,42,0.30) 0%, transparent 70%);
  z-index: 0;
  animation: floodlight-pulse 5s ease-in-out infinite;
}

.login-visual-top { position: relative; z-index: 1; }
/* Écusson héros : centré sur la ligne médiane (même axe que .pitch-halfway,
   left:50% du panneau), volontairement 3x plus grand que la taille de base,
   à cheval entre le bandeau de texte au-dessus et la zone terrain en dessous
   grâce à une marge négative qui le fait chevaucher les deux zones. */
.lv-crest-hero {
  position: relative; z-index: 2;
  display: block; height: 192px; width: auto;
  margin: -18px auto 4px;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.55));
  opacity: 0; transform: translateY(-10px) scale(0.94);
  animation: crest-reveal 0.6s ease forwards;
  animation-delay: 0.05s;
}
.lv-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fff-gold); margin-bottom: 8px; }
.login-visual-top h2 { font-size: 24px; font-weight: 800; line-height: 1.25; margin-bottom: 8px; text-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.lv-tagline { font-size: 13.5px; color: rgba(255,255,255,0.78); font-weight: 500; }

/* Démarche en 4 étapes, reprise telle quelle de la bannière EvalForm :
   pas une numérotation décorative, le vocabulaire réel du produit. */
.lv-etapes { position: relative; z-index: 1; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.lv-etapes li {
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transform: translateX(-10px);
  animation: etape-reveal 0.5s ease forwards;
  animation-delay: calc(0.15s + var(--stagger, 0) * 0.12s);
}
.lv-etape-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.12); color: var(--fff-gold);
  border: 1px solid rgba(255,255,255,0.16);
}
.lv-etape-icon .icon { width: 17px; height: 17px; }
.lv-etape-mot { font-size: 14.5px; font-weight: 700; letter-spacing: 0.02em; color: rgba(255,255,255,0.92); }

@keyframes etape-reveal {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes crest-reveal {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bas du panneau visuel : ballon + repère de saison, ancrés en bas. */
.login-visual-bottom { position: relative; z-index: 1; margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }

.ball-wrap { width: 74px; }
.football-ball { width: 74px; height: 74px; display: block; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35)); animation: ball-bounce 4.4s ease-in-out infinite; }
.ball-shadow { width: 50px; height: 10px; margin: 6px auto 0; border-radius: 50%; background: rgba(0,0,0,0.35); filter: blur(3px); animation: ball-shadow-pulse 4.4s ease-in-out infinite; }

.lv-saison {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.16);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}

@keyframes ball-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(120deg); }
}
@keyframes ball-shadow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50%      { transform: scale(0.75); opacity: 0.18; }
}
@keyframes floodlight-pulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* --- Panneau formulaire --- */
.login-panel { display: flex; align-items: center; justify-content: center; padding: 30px; background: white; }
.login-card { background: white; padding: 0; width: 100%; max-width: 320px; opacity: 0; transform: translateY(8px); animation: card-reveal 0.5s ease forwards; animation-delay: 0.1s; }
.login-card h1 { font-size: 19px; color: var(--fff-blue); margin-bottom: 20px; }
.login-card label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

@keyframes card-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Champs avec icône + bascule d'affichage du mot de passe. */
.input-icon-group { position: relative; margin-bottom: 18px; }
.input-icon-group input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 12px 12px 42px; font-size: 16px; min-height: 46px;
}
.input-icon-group input:focus { outline: none; border-color: var(--fff-blue); box-shadow: 0 0 0 3px rgba(0,48,135,0.14); }
.input-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; pointer-events: none;
}
.input-icon .icon { width: 18px; height: 18px; }
.input-icon-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer;
}
.input-icon-toggle:hover { background: var(--bg); color: var(--fff-blue); }
.input-icon-toggle:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.input-icon-toggle .icon { width: 18px; height: 18px; }

.login-card .btn-primary { width: 100%; }
.login-card .btn-primary.is-loading { opacity: 0.75; pointer-events: none; }

.login-forgot { text-align: center; margin-top: 4px; }
.login-forgot a { color: var(--fff-blue); font-size: 13px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 820px) {
  .login-stage { grid-template-columns: 1fr; max-width: 420px; min-height: 0; }
  .login-visual { padding: 26px 24px 30px; gap: 18px; }
  .login-visual-top h2 { font-size: 19px; }
  .lv-crest-hero { height: 132px; margin: -6px auto 2px; }
  .lv-etapes { flex-direction: row; flex-wrap: wrap; gap: 10px 16px; }
  .ball-wrap { width: 54px; }
  .football-ball { width: 54px; height: 54px; }
  .pitch-circle { width: 90px; height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .football-ball, .ball-shadow, .floodlight { animation: none; }
  .lv-etapes li, .login-card, .lv-crest-hero { opacity: 1; transform: none; animation: none; }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .fields-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 44px; gap: 10px; }
  .app-header h1 { font-size: 13px; }
  /* Tableaux : défilement horizontal contenu, pas de casse de mise en page */
  .panel { overflow-x: auto; }
  table.data { min-width: 560px; }
  .detail-identity { grid-template-columns: 1fr 1fr; }
}

/* --- Respect de prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   BMF — onglets de phase, boutons de score, bilan comparatif
   ===================================================================== */

.phase-tabs { display: flex; flex-wrap: wrap; gap: 8px; background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; margin-bottom: 20px; position: sticky; top: 8px; z-index: 10; }
.phase-tab-btn { flex: 1; min-width: 96px; min-height: 46px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.phase-tab-btn .tab-num { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.phase-tab-btn.active { background: var(--fff-blue); color: white; }
.phase-tab-btn.active .tab-num { background: var(--fff-gold); color: var(--text); } /* bleu sur doré = 3.64:1, insuffisant à cette taille — texte foncé = 6.67:1 */
.phase-tab-btn:not(.active):hover { background: var(--bg); }

.phase-page { display: none; }
.phase-page.active { display: block; animation: reveal 0.2s ease; }

.phase-intro { background: linear-gradient(135deg, var(--fff-blue), var(--fff-blue-700)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 18px; color: white; }
.phase-intro h2 { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.phase-intro p { font-size: 12.5px; opacity: 0.82; margin-top: 4px; }

.bmf-dimension-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fff-blue); padding: 12px 18px; background: #EEF2FB; }

.score-item { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.score-item:last-child { border-bottom: none; }
.score-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
.score-item-name { font-size: 14.5px; font-weight: 600; color: var(--text); }

.score-input { display: flex; gap: 6px; }
.score-input input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.score-input label {
  flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--bg); color: var(--muted);
  font-weight: 700; font-size: 15px; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.12s, background 0.12s, color 0.12s;
}
.score-input label:hover { transform: translateY(-1px); }
.score-input input:focus-visible + label { outline: 3px solid var(--ring); outline-offset: 2px; }
.score-input input:checked + label.score-1 { background: var(--score-1); color: white; }
.score-input input:checked + label.score-2 { background: var(--score-2); color: white; }
.score-input input:checked + label.score-3 { background: var(--score-3); color: var(--text); }
.score-input input:checked + label.score-4 { background: var(--score-4); color: white; }
.score-input input:checked + label.score-5 { background: var(--score-5); color: white; }

.score-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; font-size: 12px; color: var(--muted); }
.score-legend span { display: inline-flex; align-items: center; gap: 5px; }
.score-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.bmf-nav { display: flex; gap: 12px; margin-top: 18px; }
.bmf-nav .btn { flex: 1; }

/* Indicateur de progression global (au-dessus des onglets de phase) */
.bmf-progress { height: 8px; border-radius: 999px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.bmf-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--fff-gold), var(--fff-blue)); border-radius: 999px; transition: width 0.3s ease; }
.bmf-progress-label { font-size: 12px; color: var(--muted); font-weight: 700; margin: 6px 2px 18px; text-align: right; }

/* Compteur de critères notés, affiché dans l'intro (fond bleu) de chaque étape de notation */
.bmf-phase-counter { font-size: 12.5px; font-weight: 700; color: white; margin-top: 8px; } /* doré sur fond bleu = 3.64:1, insuffisant à cette taille — blanc = 9.65:1 */

/* Chips de bilan (tableau comparatif prédiction / auto / formateur) */
.score-chip { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; font-weight: 800; font-size: 14px; background: var(--bg); color: var(--muted); }
.score-chip-1 { background: var(--score-1); color: white; }
.score-chip-2 { background: var(--score-2); color: white; }
.score-chip-3 { background: var(--score-3); color: var(--text); }
.score-chip-4 { background: var(--score-4); color: white; }
.score-chip-5 { background: var(--score-5); color: white; }

.ecart-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.ecart-chip.good { background: #d4edda; color: #155724; }
.ecart-chip.medium { background: #fff3cd; color: #856404; }
.ecart-chip.bad { background: #f8d7da; color: #721c24; }
.ecart-chip-empty { color: var(--muted); font-size: 12px; }

.bmf-radars { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 18px; }
.bmf-radar-block { text-align: center; }
.bmf-radar-block h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fff-blue); margin-bottom: 10px; }
.bmf-radar-block canvas { max-width: 220px; }

@media (max-width: 640px) {
  .score-item-header { flex-direction: column; align-items: flex-start; }
  .phase-tab-btn { min-width: 74px; font-size: 11px; }
  .bmf-nav { flex-direction: column; }
}

/* ==========================================================================
   Tableau de bord unifié — "scoreboard" + zones par module (Séance / BMF / Match)
   ========================================================================== */

.scoreboard {
  background: linear-gradient(135deg, var(--fff-blue), var(--fff-blue-700));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 26px;
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
}
/* Variantes de couleur pour les tableaux de bord propres à un module. */
.scoreboard.scoreboard-bmf { background: linear-gradient(135deg, #a5883d, var(--fff-gold)); }
.scoreboard.scoreboard-match { background: linear-gradient(135deg, #b0151b, var(--fff-red)); }
.scoreboard.scoreboard-bmf .scoreboard-head .saison,
.scoreboard.scoreboard-match .scoreboard-head .saison { color: white; opacity: 0.85; }
.scoreboard::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 64px);
  pointer-events: none;
}
.scoreboard-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; position: relative; flex-wrap: wrap; gap: 8px; }
.scoreboard-head h2 { color: white; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.scoreboard-head .saison { color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; } /* doré sur fond bleu = 3.64:1, insuffisant à cette taille */
.scoreboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; position: relative; }
.scoreboard-cell { text-align: center; padding: 4px 10px; }
.scoreboard-cell .num { color: white; font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.scoreboard-cell .num small { font-size: 15px; color: rgba(255,255,255,0.68); font-weight: 700; }
.scoreboard-cell .lbl { color: rgba(255,255,255,0.68); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 8px; }

.pitch-thirds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; position: relative; }
.pitch-thirds::before {
  content: ''; position: absolute; top: 50%; left: 8px; right: 8px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 16px);
  z-index: 0;
}
.zone-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; position: relative; z-index: 1;
  border-top: 4px solid var(--zone-color, var(--fff-blue));
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.zone-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.zone-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.zone-card-head h3 { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: 0.01em; }
.zone-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--zone-color, var(--fff-blue)); color: white;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.zone-stat-row { display: flex; align-items: baseline; gap: 8px; }
.zone-stat-row .n { font-size: 30px; font-weight: 800; color: var(--zone-color, var(--fff-blue)); font-variant-numeric: tabular-nums; line-height: 1; }
.zone-stat-row .u { font-size: 12px; color: var(--muted); font-weight: 600; }
.zone-track { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.zone-track-fill { height: 100%; border-radius: 999px; background: var(--zone-color, var(--fff-blue)); transition: width 0.5s ease; }
.zone-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.zone-foot a { color: var(--zone-color, var(--fff-blue)); font-weight: 700; text-decoration: none; }
.zone-foot a:hover { text-decoration: underline; }

/* Activité récente unifiée (liste d'évaluations tous modules confondus) */
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: grid; grid-template-columns: 100px 1fr 110px 120px 120px; gap: 12px; align-items: center; padding: 12px 18px; font-size: 13.5px; }
.activity-row.activity-head { font-weight: 700; text-transform: uppercase; font-size: 10.5px; color: var(--muted); letter-spacing: 0.05em; padding-bottom: 8px; }
.activity-row:not(.activity-head):nth-child(even) { background: #FAFBFD; }
.activity-name { font-weight: 700; color: var(--text); }
.activity-row a { color: var(--fff-blue); font-weight: 600; text-decoration: none; }
.activity-row a:hover { text-decoration: underline; }

.module-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px;
  color: white; width: fit-content;
}
.module-chip.m-seance { background: var(--fff-blue); }
.module-chip.m-bmf { background: var(--fff-gold); color: var(--text); } /* blanc sur doré échoue le contraste AA (2.65:1) */
.module-chip.m-match { background: var(--fff-red); }

.activity-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.activity-score.score-good { color: var(--score-1); }
.activity-score.score-mid { color: var(--score-3); }
.activity-score.score-low { color: var(--score-5); }

@media (max-width: 820px) {
  .pitch-thirds { grid-template-columns: 1fr; }
  .pitch-thirds::before { display: none; }
}
@media (max-width: 640px) {
  .activity-row { grid-template-columns: 1fr; row-gap: 4px; }
  .activity-row.activity-head { display: none; }
}
