:root {
  /* Theme lấy cảm hứng từ ONE Group: nền sáng tinh gọn, điểm nhấn xanh lam đậm #0D4C92 và vàng #F2C94C */
  --bg: #ffffff;
  --panel: #f8fafc;
  --muted: #5f6b7a;
  --text: #0b1324;
  --primary: #0D4C92;
  --primary-600: #0b417e;
  --primary-700: #083561;
  --accent: #F2C94C;
  --green: #00a884;
  --red: #e05656;
  --yellow: #F2C94C;
  --purple: #7f6aa8;
  --border: rgba(13, 76, 146, 0.12);
  --border-hover: rgba(13, 76, 146, 0.24);
  --shadow: 0 8px 24px rgba(13,76,146,0.12);
  --shadow-lg: 0 16px 48px rgba(13,76,146,0.18);
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.main-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
}

/* Centered test wrapper */
.test-wrap {
  max-width: 900px;
  margin: 24px auto 64px;
  padding: 0 16px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Hero Styles */
.hero {
  text-align: center;
  margin-bottom: 48px;
  padding: 48px 0;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-logo {
  height: 56px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 32px;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 32px;
}

.test-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 32px 0;
}

.test-header.compact {
  padding: 16px 0 8px;
}

.test-logo {
  height: 48px;
  margin-bottom: 8px;
}

.test-header h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.test-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
}

/* Test Selection */
.test-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

.test-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.test-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.test-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.test-card:hover::before {
  transform: scaleX(1);
}

.test-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.test-card h2 {
  font-size: 1.75rem;
  margin-bottom: 12px;
  color: var(--text);
}

.test-description {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 1.1rem;
}

.test-features {
  list-style: none;
  margin-bottom: 32px;
  text-align: left;
}

.test-features li {
  padding: 8px 0;
  color: var(--muted);
  position: relative;
  padding-left: 24px;
}

.test-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: bold;
}

.test-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.test-button:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,124,255,0.3);
}

/* Stats Section */
.stats-section {
  margin-top: 64px;
}

.stats-section h3 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 32px;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.stat-item {
  text-align: center;
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 1rem;
}

/* Info Section */
.info-section {
  margin-top: 64px;
}

.info-section h3 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 32px;
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.info-item {
  text-align: center;
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.info-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.info-item h4 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.info-item p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Form Styles */
section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

/* Card utility for sections */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  color: var(--text);
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

input, select, textarea {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,124,255,0.15);
  background: rgba(79,124,255,0.05);
}

button {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

button:hover { background: var(--primary-600); transform: translateY(-1px); box-shadow: var(--shadow); }

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.secondary:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hover);
}

button.primary { background: var(--accent); color: #1b1b1b; }

button.primary:hover {
  background: linear-gradient(135deg, #00a876, #008f6b);
}

/* Quiz Styles */
.quiz-header {
  margin-bottom: 32px;
}

.quiz-header h2 {
  text-align: center;
  margin-bottom: 16px;
}

.meta.center {
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  width: 0%;
  transition: width 0.3s ease;
}

#questions-container {
  margin-bottom: 32px;
}

.question {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  display: none;
}

.question:hover {
  box-shadow: var(--shadow);
}

.question.active {
  display: block;
}

.question h4 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: var(--text);
  line-height: 1.5;
}

.question-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option:hover { background: #f9fafb; border-color: var(--border-hover); }

.option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
}

.option input[type="radio"]:checked + span {
  color: var(--primary);
  font-weight: 600;
}

.option.selected { border-color: var(--primary); background: rgba(13,76,146,0.08); }

.no-header .main-header { display: none; }

.quiz-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.quiz-navigation {
  text-align: center;
}

/* Result Styles */
.result-summary {
  text-align: center;
  margin-bottom: 32px;
}

.score-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.score-card {
  background: linear-gradient(135deg, rgba(79,124,255,0.1), rgba(185,156,217,0.1));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.score-card h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.score-max {
  color: var(--muted);
  font-size: 1rem;
}

.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-actions .primary {
  min-width: 120px;
}

/* Footer */
.main-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
}

.footer-section p {
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.6;
  font-size: 0.9rem;
}

.footer-section p strong {
  color: var(--text);
  font-weight: 600;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.footer-link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.footer-bottom p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Utility Classes */
.hidden { display: none !important; }
.meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 12px; }
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(79,124,255,0.1);
  border: 1px solid rgba(79,124,255,0.25);
  color: #cfe0ff;
  font-size: 0.85rem;
  font-weight: 500;
}

.success { color: var(--green); }
.error { color: var(--red); }
.warning { color: var(--yellow); }

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px 32px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .main-nav {
    gap: 1rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .test-selection {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .test-card {
    padding: 24px;
  }
  
  .quiz-actions {
    flex-direction: column;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  section {
    padding: 20px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* EQ Result Styles */
.eq-main-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.eq-score-display {
  text-align: center;
}

.eq-score-value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.eq-score-max {
  font-size: 1.5rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.eq-score-category {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-700);
  margin-top: 0.5rem;
}

.eq-percentage {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.eq-groups {
  margin: 2rem 0;
}

.eq-groups h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 1.3rem;
}

.eq-group {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.eq-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.eq-group-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1.1rem;
}

.eq-group-score {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.eq-group-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.eq-group-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.eq-group-assessment {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
}

.eq-description {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--panel);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.eq-description p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.eq-description p:last-child {
  margin-bottom: 0;
}

.test-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .eq-main-score {
    flex-direction: column;
    gap: 1rem;
  }
  
  .eq-score-value {
    font-size: 3rem;
  }
  
  .eq-percentage {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .test-header h1 {
    font-size: 2rem;
  }
  
  .test-card {
    padding: 20px;
  }
  
  .question {
    padding: 20px;
  }
  
  .eq-score-value {
    font-size: 2.5rem;
  }
  
  .eq-percentage {
    font-size: 2rem;
  }
}
