/* ==========================================================================
   NEUROSTUDY - SISTEMA DE ESTILOS Y DISEÑO EDUCATIVO
   Paleta Principal Obligatoria:
   - Azul Principal: #7294c1
   - Azul Claro / Fondo: #d4e1f6
   ========================================================================== */

:root {
  --primary: #7294c1;
  --primary-dark: #4f74a6;
  --primary-darker: #325684;
  --primary-light: #9db7d9;
  --primary-subtle: #ebf2fb;
  --bg-light: #d4e1f6;
  --bg-subtle: #f5f8fd;
  --bg-card: #ffffff;
  --text-main: #1d2d44;
  --text-muted: #576d8c;
  --border-color: #bcd2ee;
  --border-light: #e2ecf9;
  --accent-green: #2e7d32;
  --accent-green-bg: #e8f5e9;
  --accent-amber: #d97706;
  --accent-amber-bg: #fef3c7;
  --accent-red: #c62828;
  --accent-red-bg: #ffebee;
  --shadow-sm: 0 2px 8px rgba(114, 148, 193, 0.12);
  --shadow-md: 0 6px 20px rgba(114, 148, 193, 0.18);
  --shadow-lg: 0 12px 36px rgba(114, 148, 193, 0.24);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET GENERAL Y TIPOGRAFÍA */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* CLASES UTILITARIAS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.badge-soft {
  background-color: var(--bg-light);
  color: var(--primary-darker);
}

.badge-success {
  background-color: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge-warning {
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.badge-danger {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN SUPERIOR (HEADER)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-text-block h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-darker);
  line-height: 1.1;
}

.brand-text-block span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.4px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--bg-light);
  color: var(--primary-darker);
}

.nav-link.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(114, 148, 193, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-header-ghost {
  background: var(--bg-light);
  color: var(--primary-darker);
  border-color: var(--border-color);
}

.btn-header-ghost:hover {
  background: var(--primary);
  color: #ffffff;
}

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

.btn-header-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.user-profile-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--primary-darker);
}

/* ==========================================================================
   CONTENEDOR DE VISTAS (SPA ROUTING)
   ========================================================================== */
.main-view-container {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px 24px;
}

.app-view {
  display: none;
  animation: viewFadeIn 0.35s ease-out;
}

.app-view.active {
  display: block;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   VISTA 1: INICIO (LANDING PAGE)
   ========================================================================== */
.hero-section {
  background: linear-gradient(145deg, #ffffff 0%, var(--bg-light) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 36px;
}

.hero-content h2 {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary-darker);
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero-content p {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-btn-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-hero {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition);
  border: none;
}

.btn-hero-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-hero-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-hero-secondary {
  background: #ffffff;
  color: var(--primary-darker);
  border: 2px solid var(--primary);
}

.btn-hero-secondary:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
}

.hero-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-logo-display {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  animation: floatAnim 4s ease-in-out infinite;
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-neuro-badge {
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-darker);
}

/* CARDS DE LA LANDING */
.section-intro-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px auto;
}

.section-intro-header h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-darker);
  margin-bottom: 8px;
}

.section-intro-header p {
  font-size: 1rem;
  color: var(--text-muted);
}

.grid-3-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.grid-2-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 18px;
}

.feature-card h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-darker);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   VISTA 2: DASHBOARD PRINCIPAL (USUARIO AUTENTICADO)
   ========================================================================== */
.dashboard-welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dash-banner-text h2 {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.dash-banner-text p {
  font-size: 0.95rem;
  opacity: 0.92;
  max-width: 680px;
}

.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.dash-metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.dash-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.dash-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dash-metric-info span {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash-metric-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

/* HISTORIAL Y GRÁFICO EN DASHBOARD */
.dash-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.content-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.content-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.content-box-header h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-history-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-history-table th {
  background: var(--bg-light);
  color: var(--primary-darker);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: left;
}

.activity-history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}

.activity-history-table tr:hover td {
  background: #f8fafd;
}

/* ==========================================================================
   VISTA 3: ESTRATEGIAS DE ATENCIÓN
   ========================================================================== */
.strategy-category-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.strategy-category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.strategy-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.strategy-card-header h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-darker);
}

.strategy-objective-box {
  background: var(--bg-light);
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--primary-darker);
  margin-bottom: 16px;
  font-weight: 600;
}

.strategy-steps-list {
  padding-left: 20px;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 18px;
}

.strategy-steps-list li {
  margin-bottom: 8px;
}

/* WIDGET INTERACTIVO DE RESPIRACIÓN CONSCIENTE */
.breathing-interactive-box {
  background: linear-gradient(135deg, #ffffff 0%, var(--bg-light) 100%);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  margin: 28px 0;
}

.breathing-circle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 28px auto;
  position: relative;
  width: 220px;
  height: 220px;
}

.breathing-visual-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 30px rgba(114, 148, 193, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
  user-select: none;
}

.breathing-visual-circle.inhale {
  transform: scale(1.45);
  background: #5b87bf;
}

.breathing-visual-circle.hold {
  transform: scale(1.45);
  background: #3e6ea8;
}

.breathing-visual-circle.exhale {
  transform: scale(0.9);
  background: var(--primary-darker);
}

.breathing-phase-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.breathing-timer-count {
  font-size: 1.8rem;
  font-weight: 900;
  margin-top: 4px;
}

.breathing-control-btns {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   VISTA 4: LABORATORIO DE ACTIVIDADES INTERACTIVAS (5 JUEGOS)
   ========================================================================== */
.lab-games-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.lab-game-tab-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lab-game-tab-btn:hover {
  border-color: var(--primary);
  background: var(--bg-light);
  transform: translateY(-2px);
}

.lab-game-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.lab-game-tab-btn.active .lab-tab-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.lab-tab-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: var(--transition);
}

.lab-tab-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

/* CONTENEDOR DEL JUEGO ACTIVO */
.game-stage-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.game-stats-tracker {
  display: flex;
  align-items: center;
  gap: 18px;
}

.stat-pill {
  background: var(--bg-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-darker);
}

.game-instructions-screen {
  text-align: center;
  max-width: 620px;
  margin: 40px auto;
}

.game-instructions-screen h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-darker);
  margin-bottom: 12px;
}

.game-instructions-screen p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.game-interactive-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* JUEGO 1: ENCUENTRA EL ESTÍMULO (GRID SEARCH) */
.stimulus-target-prompt {
  background: var(--bg-light);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stimulus-target-display {
  font-size: 1.8rem;
  background: #ffffff;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
}

.stimulus-grid-arena {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  max-width: 540px;
  width: 100%;
}

.stimulus-grid-item {
  aspect-ratio: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.stimulus-grid-item:hover {
  background: var(--bg-light);
  border-color: var(--primary);
  transform: scale(1.06);
}

/* JUEGO 2: MEMORIA VISUAL (SPATIAL SEQUENCE) */
.memory-matrix-arena {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 380px;
  width: 100%;
  margin: 16px auto;
}

.memory-matrix-cell {
  aspect-ratio: 1;
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.memory-matrix-cell.lit {
  background: var(--primary-darker);
  box-shadow: 0 0 20px rgba(114, 148, 193, 0.8);
  transform: scale(1.05);
}

.memory-matrix-cell.active-user:active {
  background: var(--primary);
}

/* JUEGO 3: DETECTA EL PATRÓN */
.pattern-sequence-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
  max-width: 600px;
  width: 100%;
}

.pattern-item-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-darker);
}

.pattern-item-box.target-question {
  background: var(--bg-light);
  border-color: var(--primary);
  color: var(--primary-darker);
  font-size: 2rem;
}

.pattern-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 520px;
  width: 100%;
}

.btn-pattern-option {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 2px solid var(--border-color);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-pattern-option:hover {
  border-color: var(--primary);
  background: var(--bg-light);
  transform: translateY(-2px);
}

/* JUEGO 4: ATENCIÓN SELECTIVA (STROOP) */
.stroop-stimulus-display {
  font-size: 3.5rem;
  font-weight: 900;
  margin: 32px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  user-select: none;
}

.stroop-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 440px;
  width: 100%;
}

.btn-stroop {
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

/* JUEGO 5: RETO DE CONCENTRACIÓN (GO / NO-GO) */
.gonogo-arena {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin: 20px auto;
  user-select: none;
  transition: transform 0.15s ease;
}

.gonogo-arena.flash-green {
  background: var(--accent-green-bg);
  border-color: var(--accent-green);
  transform: scale(1.05);
}

.gonogo-arena.flash-red {
  background: var(--accent-red-bg);
  border-color: var(--accent-red);
  transform: scale(0.95);
}

.btn-gonogo-action {
  background: var(--primary);
  color: #ffffff;
  padding: 16px 40px;
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.btn-gonogo-action:active {
  transform: scale(0.95);
  background: var(--primary-dark);
}

/* MODAL DE RESULTADOS DE JUEGOS */
.game-result-modal {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  z-index: 50;
  animation: viewFadeIn 0.3s ease;
}

.result-score-badge {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary-darker);
  margin: 12px 0;
}

.result-breakdown-box {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin: 16px 0 24px 0;
  font-size: 0.95rem;
  color: var(--primary-darker);
  max-width: 440px;
  width: 100%;
}

/* ==========================================================================
   VISTA 5: ESPACIO PARA DOCENTES
   ========================================================================== */
.teacher-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.teacher-resource-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.teacher-resource-card h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-darker);
  margin-bottom: 8px;
}

.teacher-resource-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ==========================================================================
   VISTA 6: BIBLIOTECA DE NEUROEDUCACIÓN
   ========================================================================== */
.neuro-article-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.neuro-article-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.neuro-article-card h4 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-darker);
  margin-bottom: 10px;
}

.neuro-article-card .author-tag {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 14px;
}

.neuro-article-card p {
  font-size: 0.94rem;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 14px;
}

/* ==========================================================================
   VISTA 7: REFERENCIAS BIBLIOGRÁFICAS (APA 7ª)
   ========================================================================== */
.search-filter-strip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.ref-search-input-field {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  margin-bottom: 14px;
}

.ref-search-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 148, 193, 0.25);
}

.ref-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-pill:hover, .btn-filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.ref-card-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.ref-card-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.ref-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ref-apa-text {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-main);
  margin-bottom: 8px;
}

.ref-link-anchor {
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.ref-link-anchor:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MODALES (AUTENTICACIÓN, PERFIL, CONFIGURACIÓN SUPABASE)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 45, 68, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
}

.auth-tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.auth-tab-btn.active {
  color: var(--primary-darker);
}

.auth-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

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

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  background: #ffffff;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 148, 193, 0.2);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  background: #ffffff;
  outline: none;
  cursor: pointer;
}

.form-error-msg {
  color: var(--accent-red);
  font-size: 0.82rem;
  margin-top: 4px;
  display: none;
}

.btn-form-submit {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-form-submit:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.demo-account-pills {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-demo-pill {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-darker);
  cursor: pointer;
  transition: var(--transition);
}

.btn-demo-pill:hover {
  background: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 32px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-content strong {
  color: var(--primary-darker);
}

/* NOTIFICACIÓN TOAST */
#toastNotification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s ease;
}

#toastNotification.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   DISEÑO RESPONSIVO (MÓVILES Y TABLETAS)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 36px 24px;
  }
  .hero-btn-group {
    justify-content: center;
  }
  .grid-3-cards, .dash-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lab-games-selector {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-two-columns {
    grid-template-columns: 1fr;
  }
  .teacher-resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open {
    display: flex;
  }
  .nav-link {
    width: 100%;
    padding: 12px;
  }
  .grid-3-cards, .grid-2-cards, .dash-metrics-grid, .teacher-resource-grid {
    grid-template-columns: 1fr;
  }
  .lab-games-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-content h2 {
    font-size: 1.7rem;
  }
  .stimulus-grid-arena {
    grid-template-columns: repeat(4, 1fr);
  }
  .pattern-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
