/* ============================================================
   BJJ GRADES — style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --bjj-black:   #0a0a0a;
  --bjj-white:   #f5f2ed;
  --bjj-red:     #c0392b;
  --bjj-accent:  #e8d5a3;
  --bjj-muted:   #888;
  --bjj-border:  rgba(245,242,237,0.12);
  --bjj-card:    rgba(255,255,255,0.04);
  --bjj-surface: rgba(255,255,255,0.06);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
}

html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bjj-black); color: var(--bjj-white); min-height: 100vh; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 56px;
  border-bottom: 0.5px solid var(--bjj-border);
  position: sticky; top: 0; background: var(--bjj-black); z-index: 100;
}
.nav-logo { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 4px; color: var(--bjj-accent); text-decoration: none; }
.nav-links { display: flex; gap: 2px; }
.nav-link { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; color: var(--bjj-muted); text-decoration: none; transition: all 0.2s; }
.nav-link:hover { color: var(--bjj-white); }
.nav-link.active { background: var(--bjj-surface); color: var(--bjj-white); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user-name { font-size: 13px; color: var(--bjj-muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.main { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 4px; color: var(--bjj-muted); margin-bottom: 0.75rem; }
.hero-title { font-family: 'Bebas Neue', sans-serif; font-size: 72px; letter-spacing: 6px; line-height: 0.95; color: var(--bjj-white); }
.hero-title .accent { color: var(--bjj-accent); }
.hero-sub { font-size: 15px; color: var(--bjj-muted); margin-top: 1rem; font-weight: 300; }

/* ============================================================
   STEPS
   ============================================================ */
.step { margin-bottom: 2rem; }
.step.hidden { display: none; }
.step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; }
.step-num { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: var(--bjj-accent); opacity: 0.5; line-height: 1; }
.step-header h2 { font-size: 20px; font-weight: 500; }
.step-desc { font-size: 14px; color: var(--bjj-muted); margin-bottom: 1.25rem; }
.back-btn { background: transparent; border: 0.5px solid var(--bjj-border); color: var(--bjj-muted); padding: 5px 12px; border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.back-btn:hover { border-color: var(--bjj-accent); color: var(--bjj-accent); }

/* ============================================================
   SCHOOLS & PASSAGES
   ============================================================ */
.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.school-card { background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-lg); padding: 1.25rem; cursor: pointer; transition: all 0.2s; }
.school-card:hover { border-color: var(--bjj-accent); background: rgba(232,213,163,0.06); }
.school-initials { width: 36px; height: 36px; border-radius: 50%; background: rgba(232,213,163,0.15); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; color: var(--bjj-accent); margin-bottom: 10px; }
.school-card h3 { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.school-card p { font-size: 12px; color: var(--bjj-muted); }

.passage-list { display: flex; flex-direction: column; gap: 8px; }
.passage-item { background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-md); padding: 1rem 1.25rem; cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; color: var(--bjj-white); }
.passage-item:hover { border-color: var(--bjj-accent); }
.passage-name { font-size: 14px; font-weight: 500; }
.passage-date { font-size: 12px; color: var(--bjj-muted); margin-top: 2px; }

/* ============================================================
   AUTH BUTTONS
   ============================================================ */
.auth-btns { display: flex; gap: 10px; }
.btn-oauth { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border-radius: var(--radius-md); border: 0.5px solid var(--bjj-border); background: var(--bjj-card); color: var(--bjj-white); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 14px; transition: all 0.2s; flex: 1; }
.btn-oauth:hover { border-color: var(--bjj-accent); background: rgba(232,213,163,0.05); }
.oauth-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   FORM
   ============================================================ */
.form-card { background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; }
.form-card-title { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--bjj-muted); margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.form-group label { font-size: 12px; color: var(--bjj-muted); }
.required { color: var(--bjj-red); }

input[type=text], input[type=number], input[type=email], input[type=date],
select, textarea {
  background: rgba(255,255,255,0.06); border: 0.5px solid var(--bjj-border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--bjj-white); font-family: 'DM Sans', sans-serif; font-size: 14px;
  transition: border-color 0.2s; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bjj-accent); }
input::placeholder { color: var(--bjj-muted); }
select option { background: #1a1a1a; }
textarea { resize: vertical; min-height: 90px; }
.select-field { background: rgba(255,255,255,0.06); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--bjj-white); font-family: 'DM Sans', sans-serif; font-size: 13px; }

/* ============================================================
   PHOTO UPLOAD
   ============================================================ */
.photo-upload { border: 1.5px dashed var(--bjj-border); border-radius: var(--radius-md); padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.photo-upload:hover, .photo-upload.dragging { border-color: var(--bjj-accent); background: rgba(232,213,163,0.04); }
.upload-icon { font-size: 32px; margin-bottom: 10px; }
.photo-upload p { font-size: 14px; color: var(--bjj-muted); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: rgba(136,136,136,0.6) !important; }
.photo-preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 2px solid var(--bjj-accent); display: block; }
.photo-preview.hidden { display: none; }

/* ============================================================
   BARRETTES
   ============================================================ */
.barrettes-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: rgba(255,255,255,0.06); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-sm); }
.barr-count { font-size: 14px; font-weight: 500; color: var(--bjj-accent); min-width: 16px; }
.barrettes { display: flex; gap: 5px; }
.barrette { width: 20px; height: 10px; border-radius: 2px; background: rgba(255,255,255,0.12); border: 0.5px solid rgba(255,255,255,0.2); cursor: pointer; transition: all 0.15s; }
.barrette.active { background: var(--bjj-accent); border-color: var(--bjj-accent); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-md); border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--bjj-accent); color: var(--bjj-black); }
.btn-primary:hover:not(:disabled) { background: #d4be8a; }
.btn-ghost { background: transparent; color: var(--bjj-white); border: 0.5px solid var(--bjj-border); }
.btn-ghost:hover { border-color: var(--bjj-accent); color: var(--bjj-accent); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton { height: 80px; background: linear-gradient(90deg, var(--bjj-card) 25%, rgba(255,255,255,0.07) 50%, var(--bjj-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-lg); border: 0.5px solid var(--bjj-border); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ============================================================
   CONFIRMATION
   ============================================================ */
.confirm-box { text-align: center; padding: 3rem 0; }
.confirm-check { font-size: 56px; color: #4ade80; margin-bottom: 1rem; }
.confirm-title { font-family: 'Bebas Neue', sans-serif; font-size: 36px; letter-spacing: 3px; margin-bottom: 0.5rem; }
.confirm-sub { font-size: 16px; font-weight: 500; margin-bottom: 0.5rem; }
.confirm-email { font-size: 13px; color: var(--bjj-muted); margin-bottom: 2rem; }
.qr-block { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; padding: 1.5rem 2rem; background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-lg); }
.qr-label { font-size: 12px; color: var(--bjj-muted); }
.qr-url { font-size: 11px; color: var(--bjj-muted); word-break: break-all; max-width: 200px; text-align: center; }

/* ============================================================
   BELT BADGES
   ============================================================ */
.belt { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.belt-white  { background: rgba(240,237,232,0.12); color: #d4d1cc; border: 0.5px solid rgba(240,237,232,0.25); }
.belt-blue   { background: rgba(37,99,235,0.18); color: #60a5fa; border: 0.5px solid rgba(37,99,235,0.35); }
.belt-purple { background: rgba(124,58,237,0.18); color: #a78bfa; border: 0.5px solid rgba(124,58,237,0.35); }
.belt-brown  { background: rgba(146,64,14,0.22); color: #fbbf24; border: 0.5px solid rgba(146,64,14,0.4); }
.belt-black  { background: rgba(255,255,255,0.07); color: #bbb; border: 0.5px solid rgba(255,255,255,0.18); }

/* ============================================================
   DASHBOARD PROFESSEUR
   ============================================================ */
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.dashboard-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-title { font-family: 'Bebas Neue', sans-serif; font-size: 32px; letter-spacing: 3px; }
.section-sub { font-size: 13px; color: var(--bjj-muted); margin-top: 2px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.stat-card { background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-md); padding: 1rem; }
.stat-val { font-family: 'Bebas Neue', sans-serif; font-size: 34px; color: var(--bjj-accent); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--bjj-muted); margin-top: 4px; }

.filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.filter-btn { padding: 5px 12px; border-radius: 20px; border: 0.5px solid var(--bjj-border); background: transparent; color: var(--bjj-muted); font-size: 12px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.filter-btn.active, .filter-btn:hover { border-color: var(--bjj-accent); color: var(--bjj-accent); }

.search-input { margin-bottom: 12px; }

.candidates-list { display: flex; flex-direction: column; gap: 6px; }
.candidate-card { background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-left: 3px solid var(--bjj-border); border-radius: var(--radius-md); padding: 0.875rem 1.25rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 14px; }
.candidate-card:hover { border-color: var(--bjj-accent); background: rgba(232,213,163,0.04); }
.candidate-card.evaluated { border-left-color: #4ade80; }
.candidate-card.pending { border-left-color: var(--bjj-muted); }
.candidate-avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(232,213,163,0.15); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; color: var(--bjj-accent); flex-shrink: 0; overflow: hidden; }
.candidate-avatar img { width: 100%; height: 100%; object-fit: cover; }
.candidate-info { flex: 1; min-width: 0; }
.candidate-name { font-size: 14px; font-weight: 500; }
.candidate-meta { font-size: 12px; color: var(--bjj-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.candidate-status-col { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.status-badge { font-size: 11px; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.status-ok { background: rgba(74,222,128,0.1); color: #4ade80; }
.status-pending { background: rgba(136,136,136,0.1); color: var(--bjj-muted); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.hidden { display: none; }
.modal { background: #111; border: 0.5px solid rgba(255,255,255,0.15); border-radius: var(--radius-lg); width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 0.5px solid var(--bjj-border); }
.modal-candidate-info { display: flex; align-items: center; gap: 12px; }
.modal-avatar { width: 44px; height: 44px; border-radius: 50%; background: rgba(232,213,163,0.15); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 15px; color: var(--bjj-accent); }
.modal-name { font-size: 16px; font-weight: 500; }
.modal-meta { font-size: 12px; color: var(--bjj-muted); margin-top: 2px; }
.modal-close { background: transparent; border: none; color: var(--bjj-muted); font-size: 18px; cursor: pointer; padding: 4px; transition: color 0.2s; }
.modal-close:hover { color: var(--bjj-white); }
.modal-body { padding: 1.5rem; }
.modal-grid { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; }
.modal-candidate-details { }
.detail-photo-wrap { margin-bottom: 1rem; }
.detail-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); border: 0.5px solid var(--bjj-border); }
.detail-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.detail-table td { padding: 5px 0; }
.detail-table td:first-child { color: var(--bjj-muted); padding-right: 10px; white-space: nowrap; }
.modal-eval { }
.eval-section { margin-bottom: 1.25rem; }
.eval-label { font-size: 12px; color: var(--bjj-muted); display: block; margin-bottom: 8px; }
.grade-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.grade-btn { padding: 6px 14px; border-radius: var(--radius-sm); border: 0.5px solid var(--bjj-border); background: transparent; color: var(--bjj-muted); cursor: pointer; font-size: 13px; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.grade-btn.active { border-color: var(--bjj-accent); color: var(--bjj-accent); background: rgba(232,213,163,0.08); }
.grade-btn:hover:not(.active) { border-color: rgba(232,213,163,0.4); color: var(--bjj-white); }
.stars { display: flex; gap: 4px; }
.star { font-size: 26px; cursor: pointer; color: rgba(255,255,255,0.15); transition: color 0.15s; user-select: none; }
.star.lit { color: var(--bjj-accent); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 1.25rem 1.5rem; border-top: 0.5px solid var(--bjj-border); }

/* ============================================================
   RÉSULTATS
   ============================================================ */
.results-page { }
.results-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.results-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 2rem; }
.belt-section { margin-bottom: 2.5rem; }
.belt-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 0.5px solid var(--bjj-border); }
.belt-tag { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 4px; }
.belt-bar { height: 4px; border-radius: 2px; flex: 1; }
.bbar-white  { background: rgba(240,237,232,0.25); }
.bbar-blue   { background: #2563eb; }
.bbar-purple { background: #7c3aed; }
.bbar-brown  { background: #92400e; }
.bbar-black  { background: #555; }
.belt-count { font-size: 12px; color: var(--bjj-muted); white-space: nowrap; }
.results-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.results-table th { text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--bjj-muted); font-weight: 400; }
.results-table td { padding: 10px 10px; border-top: 0.5px solid var(--bjj-border); }
.results-table tr:hover td { background: rgba(255,255,255,0.02); }
.row-num { color: var(--bjj-muted); font-size: 12px; width: 30px; }
.col-nom { font-weight: 500; }
.col-date { color: var(--bjj-muted); font-size: 12px; }
.stars-cell { color: var(--bjj-accent); font-size: 13px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.admin-card { background: var(--bjj-card); border: 0.5px solid var(--bjj-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.admin-card-title { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--bjj-muted); margin-bottom: 1.25rem; }
.admin-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 6px; }
.admin-list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 0.5px solid var(--bjj-border); font-size: 14px; }
.admin-passage-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 0.5px solid var(--bjj-border); gap: 1rem; }

/* ============================================================
   TOAST
   ============================================================ */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: #1a1a1a; border: 0.5px solid var(--bjj-border); border-radius: var(--radius-md); padding: 12px 18px; font-size: 13px; transform: translateY(100px); opacity: 0; transition: all 0.3s; z-index: 999; max-width: 320px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(74,222,128,0.4); color: #4ade80; }
.toast.error { border-color: rgba(192,57,43,0.5); color: #e87168; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { font-size: 14px; color: var(--bjj-muted); padding: 2rem 0; text-align: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .main { padding: 1.5rem 1rem; }
  .hero-title { font-size: 52px; }
  .form-row, .form-row.three-col { grid-template-columns: 1fr; }
  .auth-btns { flex-direction: column; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .dashboard-controls { flex-direction: column; width: 100%; }
}
