:root {
  --D: #e74c3c;
  --I: #f39c12;
  --S: #27ae60;
  --C: #2980b9;
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #232635;
  --border: #2e3248;
  --text: #e8eaf0;
  --muted: #8892a4;
  --radius: 12px;
  --transition: 0.25s ease;
}

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

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

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ── Header ── */
.app-header {
  text-align: center;
  padding: 32px 24px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.app-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--C);
  letter-spacing: -0.5px;
}
.app-header p { color: var(--muted); margin-top: 6px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}
.btn-primary { background: var(--C); color: white; }
.btn-primary:hover { background: #1a6fa3; transform: translateY(-1px); }
.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}
.btn-success { background: var(--S); color: white; }
.btn-success:hover { background: #1e8449; }
.btn-danger { background: var(--D); color: white; }

/* ── Form Elements ── */
select, input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
select:focus, input[type="text"]:focus {
  border-color: var(--C);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.2);
}
select option { background: var(--surface2); }

/* ── Language Toggle ── */
.lang-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
}
.lang-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  transition: var(--transition);
}
.lang-btn.active { background: var(--C); color: white; }
.lang-btn:hover:not(.active) { color: var(--text); background: var(--border); }

/* ── Progress Bar ── */
.progress-wrap {
  background: var(--surface2);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--C), var(--S));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Question ── */
.question-number { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ── Options ── */
.options { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.option-item:hover {
  border-color: var(--C);
  background: rgba(41, 128, 185, 0.08);
}
.option-item.selected {
  border-color: var(--C);
  background: rgba(41, 128, 185, 0.15);
}
.option-item input[type="radio"] { margin-top: 3px; accent-color: var(--C); flex-shrink: 0; }
.option-text { flex: 1; font-size: 15px; line-height: 1.5; }

/* ── Proctoring Warning Banner ── */
.proctor-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--D);
  color: white;
  text-align: center;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.proctor-warning.show { transform: translateY(0); }

/* ── Report — Score Cards ── */
.score-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border-top: 4px solid;
}
.score-card.D { border-top-color: var(--D); }
.score-card.I { border-top-color: var(--I); }
.score-card.S { border-top-color: var(--S); }
.score-card.C { border-top-color: var(--C); }
.score-card .dim-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.score-card .dim-name { font-size: 12px; color: var(--text); margin-bottom: 6px; }
.score-card .score-number { font-size: 36px; font-weight: 800; line-height: 1; }
.score-card.D .score-number { color: var(--D); }
.score-card.I .score-number { color: var(--I); }
.score-card.S .score-number { color: var(--S); }
.score-card.C .score-number { color: var(--C); }

/* ── Charts Grid ── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card h3 {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.chart-card.full-width { grid-column: 1 / -1; }

/* ── AI Narrative ── */
.narrative-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--S);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 15px;
}
.narrative-card p { margin-bottom: 14px; }
.narrative-card p:last-child { margin-bottom: 0; }

.narrative-section { margin-bottom: 28px; }
.narrative-section:last-child { margin-bottom: 0; }
.narrative-section p { margin-bottom: 6px; }
.narrative-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--C);
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.action-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.action-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.mgmt-line { background: rgba(231,76,60,0.08); border-left: 3px solid var(--D); }
.mgmt-line .action-label { background: var(--D); color: white; }
.emp-line { background: rgba(39,174,96,0.08); border-left: 3px solid var(--S); }
.emp-line .action-label { background: var(--S); color: white; }

/* ── Style Badges ── */
.style-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  color: white;
  font-weight: 700;
  font-size: 15px;
}
.badge-D { background: var(--D); }
.badge-I { background: var(--I); }
.badge-S { background: var(--S); }
.badge-C { background: var(--C); }

/* ── Rules List ── */
.rules-list { list-style: none; padding: 0; }
.rules-list li {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 3px solid var(--C);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Violation Badge ── */
.violation-badge {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--D);
  color: var(--D);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: inline-block;
}

/* ── Loading ── */
.loading-text { text-align: center; padding: 60px; color: var(--muted); }
.loading-text .icon { font-size: 32px; margin-bottom: 12px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .score-cards { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 1.5rem; }
  .container { padding: 24px 16px; }
  .question-text { font-size: 16px; }
}
