/* ==========================================
   VARIABLES Y TOKENS DE DISEÑO (MODO NOCHE - DEFAULT)
   ========================================== */
:root {
  --background: hsl(222 47% 6%);
  --foreground: hsl(40 20% 92%);
  --foreground-dim: hsl(40 20% 85%);
  --muted: hsl(220 15% 50%);
  
  --card-bg: rgba(22, 24, 32, 0.8);
  --border: hsl(222 25% 16%);
  
  --primary: hsl(38 92% 55%);
  --primary-hover: hsl(38 92% 45%);
  --primary-foreground: hsl(222 47% 6%);
  
  --gradient-primary: linear-gradient(135deg, hsl(38 92% 55%), hsl(28 90% 50%));
  --gradient-glow: radial-gradient(ellipse at top, hsla(38, 92%, 55%, 0.12), transparent 60%);
  
  --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px -10px hsla(38, 92%, 55%, 0.3);
  
  --radius-lg: 0.75rem;
  --radius-md: 0.5rem;
  --radius-full: 9999px;
  
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ==========================================
   MODO DÍA (LIGHT MODE)
   ========================================== */
[data-theme="light"] {
  --background: hsl(0 0% 98%);
  --foreground: hsl(222 47% 6%);
  --foreground-dim: hsl(222 20% 40%);
  --muted: hsl(220 15% 45%);
  
  --card-bg: rgba(255, 255, 255, 0.9);
  --border: hsl(222 20% 85%);
  
  --primary: #1A1AFF; 
  --primary-hover: #0000e6;
  --primary-foreground: hsl(0 0% 100%);
  
  --gradient-primary: linear-gradient(135deg, #1A1AFF, #3333ff);
  --gradient-glow: radial-gradient(ellipse at top, rgba(26, 26, 255, 0.08), transparent 60%);
  
  --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px -10px rgba(26, 26, 255, 0.25);
}

/* ==========================================
   RESET BÁSICO
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* ==========================================
   TIPOGRAFÍA
   ========================================== */
.heading-1 { font-family: var(--font-heading); font-size: 2.25rem; font-weight: 700; line-height: 1.2; }
.heading-2 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.heading-3 { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 600; line-height: 1.2; }
.text-hero { font-size: 4rem; line-height: 1; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.text-foreground { color: var(--foreground); }
.text-foreground-dim { color: var(--foreground-dim); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-mono { font-family: monospace; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.leading-relaxed { line-height: 1.625; }

/* ==========================================
   ICONS LUCIDE
   ========================================== */
.w-4 { width: 1rem; } .h-4 { height: 1rem; }
.w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.mr-sm { margin-right: 0.5rem; }

/* ==========================================
   ESPACIADOS Y UTILIDADES
   ========================================== */
.mb-xs { margin-bottom: 0.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2.5rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mr-md { margin-right: 1rem; }
.pt-xl { padding-top: 3rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.max-w-lg { max-width: 48rem; margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 36rem; margin-left: auto; margin-right: auto; }

.absolute { position: absolute; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.z-10 { z-index: 10; }

/* ==========================================
   LAYOUTS
   ========================================== */
.hidden { display: none !important; }
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 2rem; }
.flex-1 { flex: 1; }

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bg-glow { background-image: var(--gradient-glow); }

.view-container {
  min-height: 100vh;
  padding: 1.5rem;
  position: relative;
}
.view-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.view-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ==========================================
   COMPONENTES UI (Glass, Botones, Nav)
   ========================================== */
.glass-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

button.glass-card { width: 100%; text-align: left; }
button.glass-card:hover { border-color: var(--primary); }
button.glass-card.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background-color: var(--card-bg); 
}

.cta-card {
  border-color: hsla(240, 100%, 55%, 0.2);
  position: relative;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--primary-foreground);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.btn-quiz-option {
  width: 100%;
  text-align: left;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: var(--card-bg);
  color: var(--foreground);
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
}
.btn-quiz-option:hover {
  border-color: var(--primary);
}

.icon-box-primary {
  width: 3rem;
  height: 3rem;
  margin-right: 10px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* LA MAGIA DE LA ALINEACIÓN EXACTA ESTÁ AQUÍ */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;          /* Todos los botones tienen exactamente 40px de alto */
  min-width: 2.5rem;       /* Los que solo tienen icono serán cuadrados perfectos */
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  transition: background-color 0.2s;
  color: var(--muted);
}
.icon-btn:hover { background-color: var(--border); color: var(--foreground); }

/* Barras de Progreso */
.progress-bar-container {
  height: 0.375rem;
  background-color: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  width: 100%;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

.top-nav {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.nav-content {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.main-content {
  max-width: 64rem;
  margin: 0 auto;
}

.hover-text-foreground:hover { color: var(--foreground); }