/* =====================================================
   COACH BREVET FED — Styles
   Palette : fond #fafafa, accent bleu #2563eb, erreur rouge #dc2626
   ===================================================== */

:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --success-light: #d1fae5;
  --error: #dc2626;
  --error-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --radius: 8px;
  --radius-sm: 4px;
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ===== LAYOUT ===== */

.screen { display: flex; flex-direction: column; min-height: 100vh; }
.screen.hidden { display: none !important; }

.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-content {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ===== HOME ===== */

.home-hero {
  text-align: center;
  margin-bottom: 40px;
}

.home-hero h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.home-hero p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ===== NAV GRID (Dashboard/Tasks) ===== */

.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.nav-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.nav-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
  transform: translateY(-1px);
}

.nav-card-dashboard { border-color: #93c5fd; background: #eff6ff; }
.nav-card-dashboard:hover { border-color: var(--accent); background: #dbeafe; }

.nav-card-tasks { border-color: #6ee7b7; background: #ecfdf5; }
.nav-card-tasks:hover { border-color: var(--success); background: #d1fae5; }

.nav-icon { font-size: 24px; line-height: 1; }
.nav-title { font-size: 15px; font-weight: 600; color: var(--text); }
.nav-desc { font-size: 12px; color: var(--text-muted); line-height: 1.3; }

/* ===== MODE GRID ===== */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mode-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
  transform: translateY(-1px);
}

.mode-card .mode-icon {
  font-size: 28px;
  line-height: 1;
}

.mode-card .mode-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mode-card .mode-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.mode-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.mode-badge-premium {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

/* =====================================================
   UPGRADE MODAL
   ===================================================== */

.upgrade-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.upgrade-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.upgrade-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.upgrade-modal h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #1e293b;
}

.upgrade-modal p {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 16px;
}

.upgrade-features {
  list-style: none;
  padding: 0;
  text-align: left;
  margin-bottom: 16px;
}

.upgrade-features li {
  font-size: 13px;
  color: #334155;
  padding: 4px 0;
}

.upgrade-price {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.upgrade-once {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
}

.upgrade-btn {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.upgrade-license {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.upgrade-license a {
  color: #2563eb;
}

.upgrade-close {
  font-size: 12px;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.upgrade-close:hover {
  color: #64748b;
}

/* ===== STATS ===== */

.stats-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stats-box h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.stat-val {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.stat-cat {
  font-size: 13px;
  color: var(--text);
  min-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s;
  min-width: 2px;
}

.stat-bar.bar-good { background: var(--success); }
.stat-bar.bar-bad  { background: var(--error); }

.stat-pct {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
}

.stat-categories { margin-bottom: 16px; }

/* ===== CONFIG ===== */

.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.config-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}

.checkbox-label:hover, .radio-label:hover { background: var(--bg); }

.checkbox-label input, .radio-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.config-select-all {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 10px;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.config-row label {
  font-size: 14px;
  color: var(--text);
}

.config-row input[type="number"] {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
}

.exam-warning {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 16px;
}

/* ===== QUESTION SCREEN ===== */

.q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.q-progress {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 16px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s;
}

.exam-timer-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.exam-timer { font-variant-numeric: tabular-nums; }
.exam-timer.timer-warning { color: var(--error); }

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  color: var(--text-muted);
}

.q-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
}

.q-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-aplus  { background: #dbeafe; color: #1e40af; }
.badge-aminus { background: #fce7f3; color: #9d174d; }
.badge-kprim  { background: #ede9fe; color: #5b21b6; }

.q-text {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
}

/* MCQ Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 15px;
  line-height: 1.5;
}

.option-label:hover { border-color: var(--accent); background: #eff6ff; }

.option-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.option-label.selected { border-color: var(--accent); background: #eff6ff; }
.option-label.correct  { border-color: var(--success); background: var(--success-light); }
.option-label.wrong    { border-color: var(--error); background: var(--error-light); }
.option-label.correct-not-selected { border-color: var(--success); background: var(--success-light); }

/* K prim */
.kprim-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.kprim-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}

.kprim-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.kprim-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-toggle {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}

.btn-toggle:hover { border-color: var(--accent); color: var(--accent); }
.btn-toggle:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-toggle.active-true {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.btn-toggle.active-false {
  border-color: var(--error);
  background: var(--error-light);
  color: var(--error);
}

/* After validation — kprim row states */
.kprim-row.row-correct { border-color: var(--success); background: var(--success-light); }
.kprim-row.row-wrong   { border-color: var(--error);   background: var(--error-light); }

/* ===== FEEDBACK ===== */

.feedback-block {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.feedback-block.correct {
  background: var(--success-light);
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.feedback-block.wrong {
  background: var(--error-light);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.feedback-kprim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
}

.feedback-kprim-row:last-child { border-bottom: none; }

.feedback-icon { font-weight: 700; width: 18px; flex-shrink: 0; }
.feedback-expected {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}
.feedback-expected.exp-true  { background: #d1fae5; color: #065f46; }
.feedback-expected.exp-false { background: #fee2e2; color: #991b1b; }

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0;
}

.score-full { background: #d1fae5; color: #065f46; }
.score-half { background: #fef3c7; color: #92400e; }
.score-zero { background: #fee2e2; color: #991b1b; }

.explanation {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-top: 8px;
}

/* ===== Q ACTIONS ===== */

.q-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ===== RESULTS ===== */

.result-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.result-score {
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.result-pct {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0;
}

.result-pct.result-pass { color: var(--success); }
.result-pct.result-fail { color: var(--error); }

.result-verdict {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 99px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
}

.verdict-pass { background: var(--success-light); color: #065f46; }
.verdict-fail { background: var(--error-light); color: #991b1b; }

.result-breakdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.result-breakdown h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Results table */
.result-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.result-table h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover > td { background: var(--bg); }

tr.row-correct > td:first-child { border-left: 3px solid var(--success); }
tr.row-half > td:first-child    { border-left: 3px solid var(--warning); }
tr.row-wrong > td:first-child   { border-left: 3px solid var(--error); }

tr.detail-row > td { background: var(--bg); padding: 12px 14px; }
tr.detail-row.hidden { display: none; }
.detail-content { font-size: 13px; line-height: 1.55; color: var(--text-muted); }
.detail-content strong { color: var(--text); }

.clickable-row { cursor: pointer; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}

.btn:active { transform: scale(0.98); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--bg-card);
  color: var(--error);
  border: 1px solid var(--border);
}

.btn-danger:hover:not(:disabled) { border-color: var(--error); background: var(--error-light); }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

.btn-back:hover { color: var(--text); }

/* ===== MISC ===== */

.muted { color: var(--text-muted); font-size: 14px; }
.hidden { display: none !important; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

.error-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--error);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
}

/* ===== BOUTON GUIDE (home) ===== */

.btn-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-guide::before { content: "\1F4CB "; }
.btn-guide:hover { border-color: var(--accent); color: var(--accent); background: #eff6ff; }

/* ===== INFO SCREEN ===== */

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.info-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Grilles de stats */
.info-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.info-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.info-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}

.info-stat-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.info-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

.info-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.info-intro {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Types de questions */
.qtype-list { display: flex; flex-direction: column; gap: 14px; }

.qtype-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.qtype-row .tag {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
}

.qtype-body { flex: 1; font-size: 14px; line-height: 1.5; }
.qtype-body p { margin-top: 4px; color: var(--text-muted); font-size: 13px; }
.info-target { color: var(--accent) !important; font-size: 12px !important; font-weight: 500; }

/* Scoring K prim */
.kprim-score-table { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.kprim-score-row {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  width: fit-content;
}
.kprim-full  { background: var(--success-light); color: #065f46; }
.kprim-half  { background: var(--warning-light);  color: #92400e; }
.kprim-zero  { background: var(--error-light);    color: #991b1b; }

/* Niveaux taxonomiques */
.level-list { display: flex; flex-direction: column; gap: 14px; }

.level-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.level-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.level-badge.w1 { background: #dbeafe; color: #1e40af; }
.level-badge.w2 { background: #ede9fe; color: #5b21b6; }
.level-badge.w3 { background: #d1fae5; color: #065f46; }

.level-body { flex: 1; font-size: 14px; line-height: 1.5; }
.level-body em { color: var(--text-muted); font-size: 13px; }

.blueprint-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.blueprint-bar-wrap > .stat-bar-wrap {
  flex: none;
  width: 120px;
  height: 6px;
}

.blueprint-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 99px;
}

.blueprint-bar-wrap span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Programme */
.programme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.prog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
}

.prog-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Deadline card */
.info-card-deadline {
  border-color: #fde68a;
  background: #fffbeb;
}

.info-card-deadline .info-card-title { border-bottom-color: #fde68a; }

.deadline-banner {
  background: #fff;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.deadline-date {
  font-size: 20px;
  font-weight: 800;
  color: #b45309;
  white-space: nowrap;
}

.deadline-label {
  font-size: 13px;
  color: #92400e;
  line-height: 1.4;
}

.info-card-deadline p {
  font-size: 14px;
  color: #78350f;
  margin-bottom: 14px;
  line-height: 1.6;
}

.timeline-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-step {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  line-height: 1.4;
}

.tl-step.done    { color: #065f46; background: var(--success-light); }
.tl-step.current { color: #92400e; background: var(--warning-light); }
.tl-step.todo    { color: var(--text-muted); background: var(--bg); }

/* Tips */
.tips-list { display: flex; flex-direction: column; gap: 12px; }

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.tip-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.tip-body { flex: 1; font-size: 14px; line-height: 1.5; }
.tip-body p { margin-top: 5px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* ===== RESPONSIVE info ===== */

@media (max-width: 640px) {
  .info-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .programme-grid { grid-template-columns: 1fr; }
  .deadline-banner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .deadline-date { font-size: 17px; }
}

/* ===== GUIDE BUTTONS (home) ===== */

.guide-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

/* Remove margin-bottom from individual btn-guide now that the wrapper handles it */
.guide-buttons .btn-guide { margin-bottom: 0; }

.btn-guide-prep::before { content: "\1F393 "; }

/* ===== PREP SCREEN ===== */

/* Parcours path */
.path-list { display: flex; flex-direction: column; gap: 6px; }

.path-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
}

.path-step.step-done    { border-left-color: var(--success); background: var(--success-light); }
.path-step.step-current { border-left-color: var(--warning); background: var(--warning-light); }
.path-step.step-todo    { border-left-color: var(--border);  background: var(--bg); }

.path-step-num {
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  color: var(--text-muted);
  padding-top: 1px;
}

.path-step-body { flex: 1; font-size: 14px; line-height: 1.5; }
.path-step-body strong { color: var(--text); }
.path-step-body .path-note {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 3px;
}

/* Posture cards */
.posture-list { display: flex; flex-direction: column; gap: 12px; }

.posture-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.posture-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 7px;
}

.posture-card p { font-size: 13px; color: #1e3a8a; line-height: 1.65; }

/* Don't list */
.dont-list { display: flex; flex-direction: column; gap: 10px; }

.dont-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--error-light);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
}

.dont-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--error);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.dont-body { flex: 1; font-size: 14px; line-height: 1.5; color: #991b1b; }
.dont-body strong { color: #991b1b; }
.dont-body p { margin-top: 5px; font-size: 13px; color: #7f1d1d; line-height: 1.55; }

/* Exam flow */
.exam-flow { display: flex; flex-direction: column; gap: 8px; }

.exam-flow-step {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.exam-flow-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  min-width: 56px;
  flex-shrink: 0;
  padding-top: 2px;
  line-height: 1.4;
}

.exam-flow-body { flex: 1; font-size: 14px; line-height: 1.5; }
.exam-flow-body strong { color: var(--text); }
.exam-flow-body p { margin-top: 4px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* Red flags grid */
.redflags-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.redflag-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #991b1b;
  background: var(--error-light);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.rf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--error);
  flex-shrink: 0;
  margin-top: 5px;
}

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

/* ===== DASHBOARD SCREEN ===== */

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
}

.dash-stat-card .dash-stat-val {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}

.dash-stat-card .dash-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-stat-done { border-color: #6ee7b7; }
.dash-stat-done .dash-stat-val { color: var(--success); }

.dash-stat-progress { border-color: #fde68a; }
.dash-stat-progress .dash-stat-val { color: var(--warning); }

.dash-stat-remaining { border-color: #fca5a5; }
.dash-stat-remaining .dash-stat-val { color: var(--error); }

/* Module list */
.dash-module-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-module {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-card);
}

.dash-module-warning { border-left: 4px solid var(--warning); background: #fffbeb; }
.dash-module-ok { border-left: 4px solid var(--success); }
.dash-module-inprogress { border-left: 4px solid var(--warning); background: var(--warning-light); }
.dash-module-todo { border-left: 4px solid var(--border); background: var(--bg); }

.dash-module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.dash-module-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  min-width: 24px;
}

.dash-module-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dash-module-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-validated { background: var(--success-light); color: #065f46; }
.badge-inprogress { background: var(--warning-light); color: #92400e; }
.badge-todo { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

.dash-module-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.dash-module-expiry { color: #b45309; }

.dash-validity-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}

.dash-validity-fill {
  height: 100%;
  border-radius: 99px;
}

.dash-validity-ok { background: var(--success); }
.dash-validity-warning { background: var(--warning); }

/* ===== TASKS SCREEN ===== */

.task-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.task-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.task-item:hover { background: var(--bg); }

.task-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
}

.task-item label {
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}

.task-item.task-done label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-warning {
  background: var(--error-light);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.5;
}

.task-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 10px;
  overflow: hidden;
}

.task-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 99px;
  transition: width 0.3s;
}

.task-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen:not(.hidden) .main-content { animation: fadeIn 0.18s ease; }

/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
  .main-content { padding: 20px 16px 48px; }

  .nav-grid { grid-template-columns: 1fr; gap: 10px; }

  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { flex-direction: row; text-align: left; padding: 16px; }
  .mode-card .mode-icon { font-size: 24px; }

  .stats-summary { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-item { padding: 8px; }
  .stat-val { font-size: 20px; }

  .stat-cat { min-width: 100px; font-size: 12px; }

  .checkbox-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .q-card { padding: 20px 16px; }
  .q-text { font-size: 16px; }

  .kprim-row { flex-direction: column; align-items: flex-start; }
  .kprim-btns { width: 100%; justify-content: flex-start; }

  .result-score { font-size: 32px; }
  table { font-size: 12px; }
  th, td { padding: 6px 8px; }

  .dash-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dash-stat-card { padding: 14px 8px; }
  .dash-stat-card .dash-stat-val { font-size: 24px; }

  .dash-module-header { gap: 6px; }
}

/* ============================================
   FLASHCARDS
   ============================================ */

.mode-card-adaptive { border-left: 4px solid #8b5cf6; }
.mode-card-flashcard { border-left: 4px solid #ec4899; }
.mode-card-knowledge { border-left: 4px solid #06b6d4; }

.fc-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
}

.fc-progress-bar {
  width: 100%;
  max-width: 500px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  position: relative;
}

.fc-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

.fc-progress-text {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 12px;
  color: var(--muted);
}

.fc-category-badge {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.fc-card-container {
  width: 100%;
  max-width: 500px;
  height: 280px;
  perspective: 1000px;
  cursor: pointer;
}

.fc-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.fc-card.flipped {
  transform: rotateY(180deg);
}

.fc-card-front, .fc-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.fc-card-front {
  background: white;
  border: 2px solid var(--border);
}

.fc-card-back {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 2px solid var(--accent);
  transform: rotateY(180deg);
  overflow-y: auto;
}

.fc-question {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.fc-answer {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.fc-flip-hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.fc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 500px;
}

.fc-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  background: white;
}

.fc-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.fc-btn:active { transform: translateY(0); }

.fc-btn-icon { font-size: 20px; }

.fc-btn-bad { border-color: #ef4444; color: #ef4444; }
.fc-btn-ok { border-color: #f59e0b; color: #f59e0b; }
.fc-btn-good { border-color: #3b82f6; color: #3b82f6; }
.fc-btn-perfect { border-color: #10b981; color: #10b981; }

.fc-btn-bad:hover { background: #fef2f2; }
.fc-btn-ok:hover { background: #fffbeb; }
.fc-btn-good:hover { background: #eff6ff; }
.fc-btn-perfect:hover { background: #ecfdf5; }

.fc-mastery-indicator {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
}

/* Résultats flashcards */
.fc-results-summary { text-align: center; }
.fc-results-streak { font-size: 18px; margin: 8px 0 16px; }
.fc-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.fc-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  gap: 4px;
  font-size: 13px;
}

.fc-result-count { font-size: 24px; font-weight: 700; }
.fc-result-perfect { background: #ecfdf5; color: #059669; }
.fc-result-good { background: #eff6ff; color: #2563eb; }
.fc-result-ok { background: #fffbeb; color: #d97706; }
.fc-result-bad { background: #fef2f2; color: #dc2626; }

/* ============================================
   CARTE DE CONNAISSANCES (Knowledge Map)
   ============================================ */

.km-summary {
  margin-bottom: 24px;
}

.km-summary-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
  margin-bottom: 8px;
}

.km-bar-mastered { background: #059669; }
.km-bar-learning { background: #2563eb; }
.km-bar-new { background: #e5e7eb; }

.km-summary-labels {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.km-label-mastered { color: #059669; }
.km-label-learning { color: #2563eb; }
.km-label-new { color: #6b7280; }

.km-streak {
  font-size: 14px;
  margin-top: 8px;
  color: var(--muted);
}

.km-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.km-category {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.km-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.km-cat-name {
  font-weight: 600;
  font-size: 14px;
}

.km-cat-stats {
  font-size: 12px;
  color: var(--muted);
}

.km-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.km-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  transition: transform 0.1s;
}

.km-cell:hover {
  transform: scale(1.5);
  z-index: 1;
}

/* Responsive flashcards */
@media (max-width: 480px) {
  .fc-card-container { height: 240px; }
  .fc-question { font-size: 16px; }
  .fc-answer { font-size: 14px; }
  .fc-buttons { grid-template-columns: repeat(2, 1fr); }
  .fc-results-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   DASHBOARD TRAINING SECTION
   ===================================================== */

.dash-training-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dash-train-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.dash-train-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.dash-train-val {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.dash-train-label {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 2px;
}

.dash-progress-container {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 8px;
}

.dash-progress-segment {
  transition: width 0.4s ease;
}

.dash-prog-mastered { background: #22c55e; }
.dash-prog-learning { background: #f59e0b; }
.dash-prog-unseen { background: #e2e8f0; }

.dash-progress-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: #64748b;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dash-dot-mastered { background: #22c55e; }
.dash-dot-learning { background: #f59e0b; }
.dash-dot-unseen { background: #cbd5e1; }

.dash-recommendation {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .dash-training-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   EXAM DATE BOX
   ===================================================== */

.exam-date-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.exam-date-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.exam-date-icon { font-size: 20px; }

.exam-date-title {
  font-weight: 600;
  font-size: 14px;
  color: #334155;
}

.exam-date-prompt {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.exam-date-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.exam-date-input {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  flex: 1;
}

.exam-countdown {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.exam-countdown-days {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.exam-countdown-unit {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
}

.exam-countdown-ok .exam-countdown-days { color: #059669; }
.exam-countdown-moderate .exam-countdown-days { color: #2563eb; }
.exam-countdown-warning .exam-countdown-days { color: #d97706; }
.exam-countdown-critical .exam-countdown-days { color: #dc2626; }
.exam-countdown-past .exam-countdown-days { color: #94a3b8; }

.exam-countdown-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.exam-countdown-date {
  font-size: 13px;
  color: #475569;
}

.exam-countdown-msg {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.exam-daily-target {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.exam-date-change {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.exam-date-change:hover { color: #2563eb; }

/* =====================================================
   BACKUP BOX
   ===================================================== */

.backup-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-top: 16px;
}

.backup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.backup-status {
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
}

.backup-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.backup-hint {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}

/* =====================================================
   FOOTER & LEGAL
   ===================================================== */

.app-footer {
  margin-top: 24px;
  padding: 16px 0 8px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.footer-disclaimer {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 8px;
}

.footer-links {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #64748b;
  text-decoration: underline;
}

.footer-links a:hover {
  color: #2563eb;
}

.footer-copy {
  color: #94a3b8;
}

.legal-content h2 {
  font-size: 16px;
  color: #1e293b;
  margin: 20px 0 8px;
}

.legal-content p, .legal-content li {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.legal-content ul {
  padding-left: 20px;
}

.legal-content a {
  color: #2563eb;
}

/* =====================================================
   FLASHCARD CONFIG SCREEN
   ===================================================== */

.fc-config-section {
  margin-bottom: 16px;
}

.fc-config-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.fc-config-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.fc-config-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.fc-config-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.fc-config-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

.fc-config-counts {
  display: flex;
  gap: 8px;
}

.fc-count-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.fc-count-btn:hover {
  border-color: #2563eb;
}

.fc-count-active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.fc-config-modes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fc-radio-label {
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-config-match {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
}
