/* НВО Тренажор — общи стилове */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1a202c; line-height: 1.6; background: #f8fafc;
}
a { color: #1e3a8a; }
a:hover { color: #1e40af; }
.muted { color: #64748b; font-size: 14px; }
.center { text-align: center; }

/* Auth pages */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.auth-card { background: #fff; max-width: 440px; width: 100%; padding: 32px; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.auth-card h1 { font-size: 24px; margin-bottom: 8px; }
.auth-card .muted { margin-bottom: 20px; }

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #334155; font-weight: 500; }
.form-stack input, .form-stack select, .form-stack textarea {
  padding: 12px 14px; font-size: 15px; border: 2px solid #e2e8f0;
  border-radius: 10px; outline: none; font-family: inherit; transition: border-color 0.15s;
}
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { border-color: #3b82f6; }

.btn-primary {
  background: #1e3a8a; color: #fff; padding: 12px 20px; font-size: 15px; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: #1e40af; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: #fff; color: #1e3a8a; padding: 10px 18px; font-size: 14px; font-weight: 600;
  border: 2px solid #1e3a8a; border-radius: 10px; cursor: pointer; text-decoration: none;
  display: inline-block;
}

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-top: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* Navbar */
.nav { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.nav .brand { font-weight: 800; color: #0f172a; text-decoration: none; font-size: 18px; }
.nav .nav-links { display: flex; gap: 16px; align-items: center; }
.nav .nav-links a { color: #475569; text-decoration: none; font-weight: 500; font-size: 14px; }
.nav .nav-links a:hover { color: #1e3a8a; }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: #1e3a8a; padding: 4px 8px; }

@media (max-width: 720px) {
  .mobile-menu-toggle { display: block; }
  .nav .nav-links { display: none; flex-direction: column; width: 100%; gap: 12px; padding: 14px 0 6px; align-items: flex-start; }
  .nav .nav-links.open { display: flex; }
  .nav .nav-links a { padding: 6px 0; }
}

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 32px 24px; }

/* Cards */
.card { background: #fff; padding: 24px; border-radius: 14px; border: 1px solid #e2e8f0; margin-bottom: 20px; }
.card h2 { font-size: 20px; margin-bottom: 12px; color: #0f172a; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }
.stat .num { font-size: 28px; font-weight: 800; color: #1e3a8a; }
.stat .label { font-size: 13px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
.table th { background: #f8fafc; font-weight: 600; color: #334155; }
.table tr:hover { background: #f8fafc; }

/* Test UI */
.test-question { background: #fff; padding: 28px; border-radius: 14px; border: 1px solid #e2e8f0; margin-bottom: 16px; }
.test-question h3 { font-size: 18px; margin-bottom: 18px; color: #0f172a; }
.test-options { display: flex; flex-direction: column; gap: 10px; }
.test-option {
  padding: 14px 18px; background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 10px;
  cursor: pointer; transition: all 0.15s; font-size: 15px;
}
.test-option:hover { border-color: #3b82f6; background: #eff6ff; }
.test-option.selected { border-color: #1e3a8a; background: #dbeafe; }
.test-option.correct { border-color: #16a34a; background: #dcfce7; }
.test-option.wrong { border-color: #dc2626; background: #fee2e2; }

.explanation {
  background: #eff6ff; border-left: 4px solid #1e3a8a; padding: 16px 20px;
  border-radius: 8px; margin-top: 16px; font-size: 14px; color: #1e3a8a;
  white-space: pre-line; line-height: 1.7;
}
.explanation strong { color: #0f172a; }

/* 🔄 Loading state докато чакаме отговор от сървъра */
.explanation.loading {
  background: #f8fafc; border-left-color: #94a3b8; color: #64748b;
  font-style: italic; text-align: center;
  animation: nvo-pulse 1.4s ease-in-out infinite;
}
@keyframes nvo-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Деактивирани опции по време на зареждане */
.test-option[style*="pointer-events: none"] {
  opacity: 0.55; cursor: wait;
}

/* Progress bar */
.progress { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 12px 0; }
.progress > div { height: 100%; background: linear-gradient(90deg, #1e3a8a, #3b82f6); transition: width 0.3s; }
