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

:root {
  --navy: #0a1628;
  --navy-light: #132040;
  --navy-mid: #1a2d54;
  --gold: #d4a843;
  --gold-light: #e8c96a;
  --gold-dim: rgba(212, 168, 67, 0.15);
  --white: #f0f0f0;
  --gray: #8892a4;
  --green: #4caf50;
  --red: #e74c3c;
  --blue: #3498db;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Logo */
.logo-area {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  font-size: 48px;
  color: var(--gold);
  margin-bottom: 8px;
}

.logo-area h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
}

.subtitle {
  color: var(--gray);
  font-size: 16px;
  margin-top: 4px;
}

/* Info Card */
.info-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}

.info-card h2 {
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 12px;
}

.info-card p {
  color: var(--gray);
  font-size: 15px;
}

.section-preview {
  margin-top: 20px;
  display: grid;
  gap: 8px;
}

.preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--white);
  padding: 8px 12px;
  background: var(--navy);
  border-radius: 6px;
}

.preview-icon {
  color: var(--gold);
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.badge {
  margin-left: auto;
  background: var(--gold-dim);
  color: var(--gold);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Forms */
.start-form {
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--navy);
  border: 1px solid var(--navy-mid);
  border-radius: 6px;
  color: var(--white);
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group select option {
  background: var(--navy);
}

/* Buttons */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-primary:hover {
  background: var(--gold-light);
}

.btn-secondary {
  background: var(--navy-mid);
  color: var(--white);
}

.btn-secondary:hover {
  background: #243a6a;
}

.btn-large {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 8px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  margin-top: 24px;
}

/* Test Page */
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--navy-mid);
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.logo-small {
  color: var(--gold);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.header-center {
  flex: 1;
  max-width: 400px;
}

.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--navy-mid);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 13px;
  color: var(--gray);
  white-space: nowrap;
}

.timer {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  background: var(--navy-light);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--navy-mid);
}

.timer.warning {
  color: var(--red);
  border-color: var(--red);
}

.section-indicator {
  text-align: center;
  margin-bottom: 28px;
  padding: 16px;
  background: var(--gold-dim);
  border-radius: var(--radius);
  border: 1px solid rgba(212, 168, 67, 0.25);
}

.section-indicator h2 {
  color: var(--gold);
  font-size: 20px;
}

#sectionMeta {
  color: var(--gray);
  font-size: 13px;
  margin-top: 4px;
}

/* Questions */
.question-area {
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 280px;
}

.question-text {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 24px;
  color: var(--white);
}

.question-difficulty {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.difficulty-easy {
  background: rgba(76, 175, 80, 0.2);
  color: var(--green);
}

.difficulty-medium {
  background: rgba(212, 168, 67, 0.2);
  color: var(--gold);
}

.difficulty-hard {
  background: rgba(231, 76, 60, 0.2);
  color: var(--red);
}

.options-list {
  display: grid;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--navy);
  border: 2px solid var(--navy-mid);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-size: 15px;
  color: var(--white);
  width: 100%;
}

.option-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.option-btn.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-mid);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  color: var(--gray);
}

.option-btn.selected .option-letter {
  background: var(--gold);
  color: var(--navy);
}

.option-text {
  padding-top: 3px;
  line-height: 1.5;
}

/* Test Nav */
.test-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--navy-mid);
}

.question-counter {
  color: var(--gray);
  font-size: 14px;
}

/* Result Page */
.result-summary {
  text-align: center;
  margin-bottom: 36px;
}

.total-score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: var(--gold-dim);
}

.score-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.score-label {
  font-size: 13px;
  color: var(--gray);
  margin-top: 4px;
}

.interpretation {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.interpretation.excellent { color: var(--gold); }
.interpretation.good { color: var(--green); }
.interpretation.average { color: var(--blue); }
.interpretation.below-average { color: var(--red); }

.percentage {
  font-size: 16px;
  color: var(--gray);
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.score-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.score-card-title {
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.score-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
}

.score-card-bar {
  height: 4px;
  background: var(--navy-mid);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.score-card-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.result-actions {
  text-align: center;
}

/* Admin Page */
.admin-login {
  max-width: 400px;
  margin: 0 auto;
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 28px;
}

.error-msg {
  color: var(--red);
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

.admin-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-controls label {
  color: var(--gray);
  font-size: 14px;
}

.sort-controls select {
  padding: 8px 12px;
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: 6px;
  color: var(--white);
  font-size: 13px;
}

.sort-controls select option {
  background: var(--navy);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--navy-mid);
}

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

.results-table th {
  background: var(--navy-mid);
  color: var(--gold);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.results-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--navy-mid);
  white-space: nowrap;
}

.results-table tbody tr:hover {
  background: var(--navy-light);
}

.results-table .pct-cell {
  font-weight: 700;
}

.pct-excellent { color: var(--gold); }
.pct-good { color: var(--green); }
.pct-average { color: var(--blue); }
.pct-below { color: var(--red); }

.result-count {
  text-align: center;
  color: var(--gray);
  font-size: 13px;
  margin-top: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 20px 12px; }
  .test-header { flex-direction: column; align-items: stretch; }
  .header-left, .header-right { text-align: center; }
  .header-center { max-width: 100%; }
  .question-area { padding: 20px; }
  .score-breakdown { grid-template-columns: repeat(2, 1fr); }
  .admin-controls { flex-direction: column; }
  .results-table { font-size: 12px; }
  .results-table th, .results-table td { padding: 8px 6px; }
}
