:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent: #f59e0b;
  --border-radius: 12px;
  --transition: all 0.25s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.app-container {
  width: 100%;
  max-width: 800px;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  color: #fff;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo span {
  color: var(--accent);
  font-weight: 300;
}

.tagline {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Card layout */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.hidden {
  display: none !important;
}

/* Hero Screen */
#intro-screen h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: #0f172a;
}

.subtitle {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

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

.info-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.info-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Quiz UI */
.quiz-header {
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
}

.badge {
  background: #e0e7ff;
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.question-container h2 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.reading-box {
  background: #f1f5f9;
  border-left: 4px solid var(--primary);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  max-height: 180px;
  overflow-y: auto;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.option-btn {
  background: #fff;
  border: 2px solid #e2e8f0;
  padding: 14px 20px;
  border-radius: 8px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-main);
}

.option-btn:hover {
  border-color: var(--primary);
  background: #f0f9ff;
}

.option-btn.selected {
  border-color: var(--primary);
  background: #e0f2fe;
  font-weight: 600;
}

/* Footer & Buttons */
.quiz-footer {
  display: flex;
  justify-content: space-between;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

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

.secondary-btn {
  background: #f1f5f9;
  color: var(--text-main);
}

.secondary-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

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

/* Results View */
.results-header {
  text-align: center;
  margin-bottom: 24px;
}

.result-badge-container {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #f8fafc;
  padding: 24px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
}

.level-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.advice-card {
  background: #fffbe2;
  border: 1px solid #fef08a;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 28px;
}

.advice-card h3 {
  color: #854d0e;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.advice-card p {
  color: #713f12;
  font-size: 0.95rem;
  line-height: 1.5;
}

.main-footer {
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 24px;
}r: var(--blue-900);
  border-color: var(--blue-100);
}

.btn-secondary:hover { 
  border-color: var(--blue-500); 
}

@media (max-width: 560px) {
  .level-grid, .options-grid, .result-actions { 
    grid-template-columns: 1fr; 
    flex-direction: column;
  }
}

/* Tarjeta de Curso Recomendado */
.course-recommendation-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.course-icon {
  font-size: 2.2rem;
  background: #dcfce7;
  padding: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #15803d;
  letter-spacing: 0.5px;
}

.course-info h4 {
  color: #166534;
  font-size: 1.1rem;
  margin: 4px 0;
}

.course-info p {
  color: #14532d;
  font-size: 0.9rem;
  line-height: 1.4;
}