/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --bg:        #0a0a0f;
  --surface:   #111118;
  --surface2:  #1a1a24;
  --border:    #2a2a3a;
  --accent:    #ff3e6c;
  --accent2:   #7c3aed;
  --gold:      #fbbf24;
  --green:     #10b981;
  --text:      #e2e8f0;
  --muted:     #e5e5e5;
  --font-mono: 'JetBrains Mono', monospace;
  --font-disp: 'Syne', sans-serif;
  --radius:    8px;
  --radius-lg: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
}
.btn:hover:not(:disabled) { opacity: .85; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn--primary  { background: var(--accent);  color: #fff; }
.btn--success  { background: var(--green);   color: #fff; }
.btn--danger   { background: var(--accent);  color: #fff; }
.btn--ghost    { background: transparent; color: var(--muted); border: 1px solid var(--muted); }
.btn--ghost:hover:not(:disabled) { border-color: var(--muted); color: var(--text); }
.btn--sm       { padding: 6px 12px; font-size: 12px; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-error {
  color: var(--accent);
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255,62,108,.08);
  border: 1px solid rgba(255,62,108,.25);
  border-radius: 6px;
}

/* ============================================================
   TOASTS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  min-width: 220px;
  animation: slideIn .3s ease;
  border-left: 3px solid var(--green);
  pointer-events: all;
}
.toast--error { border-left-color: var(--accent); }
.toast--info  { border-left-color: var(--accent2); }

/* ============================================================
   LOGIN CARD (partagé par teacher + exercises)
   ============================================================ */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1a0a2e 0%, var(--bg) 60%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  width: 380px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent2), var(--gold));
}

.login-title { font-family: var(--font-disp); font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.login-sub   { color: var(--muted); font-size: 13px; margin-bottom: 32px; }

.field {
  display: block;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  margin-bottom: 12px;
}
.field:focus { border-color: var(--accent2); }

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.top-logo { font-family: var(--font-disp); font-weight: 800; font-size: 20px; }
.top-logo span { color: var(--accent); }
.top-spacer { flex: 1; }

/* ============================================================
   CARDS (dashboard)
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ============================================================
   DOT PULSE (loader)
   ============================================================ */
.dot-pulse { display: flex; gap: 4px; }
.dot-pulse span {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}
.dot-pulse span:nth-child(2) { animation-delay: .2s; }
.dot-pulse span:nth-child(3) { animation-delay: .4s; }

/* ============================================================
   STATUS PILLS
   ============================================================ */
.status-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill--active   { background: rgba(16,185,129,.15); color: var(--green);  border: 1px solid var(--green); }
.status-pill--inactive { background: var(--surface2);      color: var(--muted);  border: 1px solid var(--border); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--muted); }
.text-gold  { color: var(--gold); }
.display-title { font-family: var(--font-disp); font-size: 56px; font-weight: 800; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse {
  0%, 80%, 100% { opacity: .2; transform: scale(.8); }
  40%           { opacity: 1;  transform: scale(1); }
}
@keyframes slideIn  { from { opacity:0; transform: translateX(20px); } to { opacity:1; } }
@keyframes slideUp  { from { opacity:0; transform: translateY(12px); } to { opacity:1; } }
@keyframes flash    { 0%,100% { opacity:1; } 50% { opacity:.4; } }
@keyframes fadeIn   { from { opacity:0; transform: translateX(-8px); } to { opacity:1; } }

/* ============================================================
   RESPONSIVE (commun à toutes les pages)
   ============================================================ */
@media (max-width: 680px) {
  .login-card  { width: 95%; padding: 28px 18px; }
  .login-title { font-size: 22px; }
  .top-bar     { padding: 0 12px; gap: 10px; }
  .top-logo    { font-size: 17px; }
  .card        { padding: 14px; }
}
