@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #070b19;
  --bg-card: rgba(18, 28, 56, 0.7);
  --bg-card-hover: rgba(28, 42, 80, 0.85);
  --border-glass: rgba(0, 242, 254, 0.15);
  --border-glass-hover: rgba(0, 242, 254, 0.4);
  --primary-cyan: #00f2fe;
  --primary-blue: #4facfe;
  --accent-gold: #ffb703;
  --accent-green: #00e676;
  --accent-red: #ff5252;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --shadow-glow: 0 0 30px rgba(0, 242, 254, 0.18);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

.bg-glow-1 {
  position: fixed;
  top: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.bg-glow-2 {
  position: fixed;
  bottom: -15%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

/* Navbar */
.app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 19, 43, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Navegación y pestañas siempre visibles para el alumno */
.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--primary-cyan);
}

.nav-brand-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: #070b19;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  border-color: var(--primary-cyan);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.nav-actions-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-stats {
  display: flex;
  gap: 0.8rem;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.9rem;
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
}

.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  user-select: none;
}

.mobile-menu-toggle:hover, .mobile-menu-toggle:active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.sync-status-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-user-btn {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.42rem 0.95rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-user-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: var(--primary-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.nav-user-btn.user-logged-in {
  border-color: var(--accent-green);
  background: rgba(0, 230, 118, 0.12);
  color: #fff;
}

/* Modal de Autenticación Supabase */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 9, 23, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.auth-modal-card {
  background: rgba(14, 23, 47, 0.98);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 2.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  position: relative;
  box-sizing: border-box;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 99;
  pointer-events: auto;
}

.modal-close-btn:hover {
  background: rgba(255, 56, 96, 0.2);
  color: #ff3860;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin-bottom: 0.8rem;
  border: 1px solid var(--primary-cyan);
}

.auth-header h3 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1.45rem;
  margin: 0;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.4rem;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #070b19;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.25);
}

.auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.auth-input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.auth-alert {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.auth-alert.error {
  background: rgba(255, 56, 96, 0.15);
  border: 1px solid #ff3860;
  color: #ff3860;
}

.auth-alert.success {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.auth-submit-btn {
  width: 100%;
  padding: 0.95rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  cursor: pointer;
}

.auth-footer-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-link-guest {
  background: transparent;
  border: none;
  color: var(--primary-cyan);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  font-size: 0.85rem;
}

.btn-link-guest:hover {
  color: #fff;
}

/* Vista Perfil */
.auth-profile-box {
  text-align: center;
  padding: 1rem 0;
}

.profile-avatar {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.auth-profile-box h4 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1.3rem;
  margin: 0;
}

.profile-email {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.3rem 0;
}

/* App Container */
.app-container {
  flex: 1;
  max-width: 1250px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.view-section {
  animation: fadeIn 0.4s ease;
}

.view-section.hidden {
  display: none !important;
}

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

/* Hero Banner */
.hero-banner {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.badge-hero {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--primary-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-banner h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}

.hero-banner p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 700px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.metric-card.alert-card {
  border-color: rgba(255, 82, 82, 0.3);
  background: rgba(255, 82, 82, 0.08);
}

.metric-icon {
  font-size: 2rem;
}

.metric-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

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

/* Actions Grid */
.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-cyan);
  transform: translateY(-5px);
}

.action-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.action-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.action-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.action-link {
  color: var(--primary-cyan);
  font-weight: 700;
  font-size: 0.9rem;
}

/* COURSE PLATFORM LAYOUT */
.course-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

.course-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.course-topics-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sidebar-topic-group {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid transparent;
}

.sidebar-topic-group.active {
  border-color: rgba(0, 242, 254, 0.2);
  background: rgba(0, 242, 254, 0.04);
}

.sidebar-topic-item {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.92rem;
}

.sidebar-topic-item:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--border-glass);
}

.sidebar-topic-item.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
  font-weight: 700;
  color: #fff;
}

.topic-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sublessons-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.5rem 0.6rem 1rem;
}

.sublesson-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.83rem;
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sublesson-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.sublesson-btn.active-sub {
  color: var(--primary-cyan);
  font-weight: 700;
  background: rgba(0, 242, 254, 0.12);
}

.status-done {
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 700;
}

/* COURSE READER AREA */
.course-reader {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.lesson-header-banner {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lesson-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.lesson-count-tag {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lesson-header-banner h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.3;
}

.lesson-body-card {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #e2e8f0;
  margin-bottom: 2.5rem;
}

.lesson-body-card h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--primary-cyan);
  margin-bottom: 1.5rem;
}

.lesson-body-card h4 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary-blue);
  margin: 1.8rem 0 1rem 0;
}

.lesson-body-card ul, .lesson-body-card ol {
  margin-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.lesson-body-card li {
  margin-bottom: 0.6rem;
}

/* DIAGRAM CONTAINER & IMAGES */
.diagram-container {
  background: rgba(11, 19, 43, 0.9);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.2rem;
  margin: 1.8rem 0 2.2rem 0;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.diagram-container:hover {
  border-color: var(--primary-cyan);
  box-shadow: var(--shadow-glow);
}

.lesson-diagram-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.diagram-caption {
  display: block;
  font-size: 0.88rem;
  color: var(--primary-cyan);
  margin-top: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.data-table th, .data-table td {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-glass);
  text-align: left;
}

.data-table th {
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary-cyan);
  font-family: var(--font-heading);
  font-weight: 700;
}

.data-table td {
  background: rgba(255, 255, 255, 0.02);
}

.tip-box {
  background: rgba(255, 183, 3, 0.12);
  border-left: 4px solid var(--accent-gold);
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: #fef08a;
}

.formula-card {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--primary-cyan);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  margin: 1.5rem 0;
  font-family: monospace;
  font-size: 1.2rem;
  color: var(--primary-cyan);
}

.lesson-navigation-bar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Temas Grid */
.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
}

.btn-hero-action {
  margin-top: 1rem;
  padding: 0.9rem 1.8rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #070b19;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
  transition: all 0.3s ease;
}

.btn-hero-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.5);
}

.temas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tema-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.tema-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-3px);
}

.tema-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.tema-tag {
  font-size: 0.78rem;
  color: var(--primary-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tema-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0.3rem 0 0.6rem 0;
}

.tema-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.tema-actions-btns {
  display: flex;
  gap: 0.6rem;
}

.btn-read-tema, .btn-start-quiz {
  flex: 1;
  padding: 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  transition: all 0.3s ease;
}

.btn-read-tema {
  background: rgba(0, 242, 254, 0.12);
  color: var(--primary-cyan);
}

.btn-read-tema:hover {
  background: var(--primary-cyan);
  color: #070b19;
}

.btn-start-quiz {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-start-quiz:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Quiz Runner */
.quiz-runner-wrapper {
  max-width: 750px;
  margin: 0 auto;
}

.quiz-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz-question-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--primary-cyan);
}

.opt-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
}

.quiz-option-btn.correct {
  background: rgba(0, 230, 118, 0.18);
  border-color: var(--accent-green);
  color: #fff;
}
.quiz-option-btn.correct .opt-letter {
  background: var(--accent-green);
  color: #000;
}

.quiz-option-btn.incorrect {
  background: rgba(255, 82, 82, 0.18);
  border-color: var(--accent-red);
  color: #fff;
}
.quiz-option-btn.incorrect .opt-letter {
  background: var(--accent-red);
  color: #fff;
}

.quiz-feedback {
  padding: 1.2rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.feedback-correct {
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: #a7f3d0;
}
.feedback-incorrect {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #fca5a5;
}

/* Flashcards 3D & Responsive Interactive Quiz Cards */
.flashcard-container {
  max-width: 720px;
  width: 100%;
  margin: 1.5rem auto 2.5rem auto;
  text-align: center;
  padding: 0 1rem;
  box-sizing: border-box;
}

.flashcard-3d {
  width: 100%;
  min-height: 440px;
  perspective: 1000px;
  margin-bottom: 1.5rem;
  position: relative;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 440px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-3d.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front {
  position: relative;
  width: 100%;
  min-height: 440px;
  backface-visibility: hidden;
  border-radius: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  box-sizing: border-box;
}

.flashcard-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  background: rgba(15, 26, 52, 0.98);
  border: 1px solid var(--primary-cyan);
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  box-sizing: border-box;
  transform: rotateY(180deg);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.2rem;
  width: 100%;
}

.card-q-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  color: #fff;
  text-align: center;
}

.fc-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 0.5rem 0 1rem 0;
}

.fc-quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  user-select: none;
}

.fc-quiz-opt:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--primary-cyan);
  transform: translateY(-2px);
}

.fc-quiz-opt .opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.fc-quiz-opt .opt-text {
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--text-main);
}

.fc-quiz-opt.correct {
  background: rgba(0, 230, 118, 0.2) !important;
  border-color: var(--accent-green) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.35);
}

.fc-quiz-opt.correct .opt-letter {
  background: var(--accent-green);
  color: #05140d;
}

.fc-quiz-opt.wrong {
  background: rgba(255, 56, 96, 0.2) !important;
  border-color: #ff3860 !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(255, 56, 96, 0.35);
}

.fc-quiz-opt.wrong .opt-letter {
  background: #ff3860;
  color: #fff;
}

.card-hint {
  font-size: 0.9rem;
  color: var(--accent-gold);
}

.flip-prompt {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-a-text {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #fff;
  text-align: center;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-control {
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-accent {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #070b19;
  border: none;
  font-weight: 700;
}

.btn-success {
  background: rgba(0, 230, 118, 0.2);
  border-color: var(--accent-green);
  color: #a7f3d0;
}

/* Fallos List */
.fallos-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: 18px;
  border: 1px solid var(--border-glass);
  margin-bottom: 2rem;
}

.fallos-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.fallo-item {
  background: var(--bg-card);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: 18px;
  padding: 1.8rem;
}

.fallo-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.btn-remove-fallo {
  background: transparent;
  border: 1px solid rgba(255, 82, 82, 0.4);
  color: var(--accent-red);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
}

.fallo-question {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.fallo-correct-ans {
  background: rgba(0, 230, 118, 0.1);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  color: #a7f3d0;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

.fallo-exp {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Calculator Card */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.calculator-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.calculator-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: monospace;
  font-size: 1.1rem;
  outline: none;
}

.calc-result {
  display: flex;
  gap: 2rem;
  padding: 1.2rem 1.8rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--primary-cyan);
  border-radius: 14px;
}

.res-item {
  display: flex;
  flex-direction: column;
}

.res-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.res-item strong {
  font-family: monospace;
  font-size: 1.5rem;
  color: var(--primary-cyan);
}

/* Recursos Grid */
.recursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.recurso-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
}

.recurso-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-glass);
}

.recurso-body {
  padding: 1.8rem;
}

.recurso-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.recurso-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.btn-primary, .btn-secondary {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #070b19;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-glass);
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive Mobile & Tablet Navbar */
@media (max-width: 1024px) {
  .app-navbar {
    padding: 0.75rem 1.2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-brand-title {
    font-size: 1.15rem;
  }

  .nav-logo-img {
    width: 32px;
    height: 32px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* El menú de 7 botones se colapsa y no ocupa espacio hasta que se pulsa el botón hamburguesa */
  .nav-links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(7, 12, 28, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--primary-cyan);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    padding: 1rem 1.2rem 1.5rem 1.2rem;
    flex-direction: column;
    gap: 0.6rem;
    box-sizing: border-box;
    animation: slideDownNav 0.25s ease-out forwards;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .nav-links.open {
    display: flex !important;
  }

  .nav-btn {
    width: 100%;
    text-align: left;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-btn.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: #070b19;
    font-weight: 700;
  }

  .course-layout {
    grid-template-columns: 1fr;
  }
}

@keyframes slideDownNav {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   MÓDULO DE EXÁMENES OFICIALES Y PREGUNTAS FRECUENTES (CARM)
   ========================================================================== */

.exam-header-banner {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.05));
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.exam-header-info h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #fff;
  margin: 0.6rem 0;
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.exam-header-info p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Selector de Pestañas de Modos */
.exam-modes-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.exam-tab-btn {
  padding: 0.9rem 1.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.exam-tab-btn:hover {
  background: rgba(0, 242, 254, 0.1);
  color: #fff;
  border-color: rgba(0, 242, 254, 0.4);
}

.exam-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.15));
  border-color: var(--primary-cyan);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

/* Tarjetas de Modos */
.exam-panel {
  animation: fadeIn 0.4s ease-out;
}

.convocatoria-card, .frecuentes-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  margin-bottom: 2rem;
}

.convocatoria-selector-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 650px;
}

.exam-select {
  padding: 1rem 1.2rem;
  background: rgba(10, 16, 37, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.exam-select:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.exam-actions-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn-primary-action {
  padding: 0.95rem 1.8rem;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  border: none;
  border-radius: 12px;
  color: #070b19;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  transition: all 0.3s ease;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.6);
}

.btn-secondary-action {
  padding: 0.95rem 1.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary-cyan);
}

.btn-fire {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: #fff;
  box-shadow: 0 0 25px rgba(255, 65, 108, 0.5);
}

.btn-fire:hover {
  box-shadow: 0 6px 30px rgba(255, 75, 43, 0.7);
}

/* Criterios Oficiales */
.criterios-oficiales-box {
  background: rgba(0, 242, 254, 0.04);
  border: 1px dashed rgba(0, 242, 254, 0.3);
  border-radius: 16px;
  padding: 1.5rem 2rem;
}

.criterios-oficiales-box h4 {
  font-family: var(--font-heading);
  color: var(--primary-cyan);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.criterios-oficiales-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.criterios-oficiales-box li {
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.5;
  position: relative;
  padding-left: 1.5rem;
}

.criterios-oficiales-box li::before {
  content: "⚓";
  position: absolute;
  left: 0;
  font-size: 0.85rem;
}

/* Modo Frecuentes Card */
.frecuentes-badge-hero {
  display: inline-block;
  background: rgba(255, 75, 43, 0.15);
  border: 1px solid rgba(255, 75, 43, 0.4);
  color: #ff4b2b;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.frecuentes-card h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 0.8rem;
}

.frecuentes-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 800px;
  margin-bottom: 2rem;
}

/* EXAMEN ACTIVO */
.exam-top-sticky {
  position: sticky;
  top: 75px;
  z-index: 100;
  background: rgba(7, 11, 25, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 18px;
  padding: 1.2rem 1.8rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.exam-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.exam-active-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
}

.exam-timer-badge {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 0.4rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  letter-spacing: 1px;
}

.exam-timer-badge.warning {
  color: #ff3860;
  background: rgba(255, 56, 96, 0.15);
  border-color: #ff3860;
  animation: pulse 1s infinite;
}

.exam-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.exam-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), var(--accent-green));
  transition: width 0.3s ease;
}

.exam-stats-summary {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

/* Cuadrícula de 45 preguntas */
.exam-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 90px;
  overflow-y: auto;
  padding-top: 4px;
}

.exam-nav-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.exam-nav-num:hover {
  border-color: var(--primary-cyan);
  color: #fff;
}

.exam-nav-num.answered {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--primary-cyan);
  color: #fff;
}

.exam-nav-num.current {
  box-shadow: 0 0 10px var(--primary-cyan);
  border-color: #fff;
}

/* Flujo de Preguntas */
.exam-questions-flow {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.exam-unit-divider {
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.15), transparent);
  border-left: 4px solid var(--primary-cyan);
  padding: 0.8rem 1.2rem;
  border-radius: 0 10px 10px 0;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
  margin-top: 1rem;
}

.exam-unit-divider.eliminatoria {
  border-left-color: #ff3860;
  background: linear-gradient(90deg, rgba(255, 56, 96, 0.15), transparent);
}

.exam-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 2rem;
  backdrop-filter: blur(16px);
  transition: border-color 0.3s;
}

.exam-question-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
}

.exam-q-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.exam-q-number {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary-cyan);
  font-size: 1.1rem;
}

.badge-repetition-fire {
  background: rgba(255, 75, 43, 0.15);
  border: 1px solid rgba(255, 75, 43, 0.4);
  color: #ff5722;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.exam-q-text {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.exam-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.exam-opt-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exam-opt-row:hover {
  background: rgba(0, 242, 254, 0.06);
  border-color: rgba(0, 242, 254, 0.25);
}

.exam-opt-row.selected {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.opt-radio-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.2s;
}

.exam-opt-row.selected .opt-radio-icon {
  border-color: var(--primary-cyan);
  background: var(--primary-cyan);
}

.exam-opt-row.selected .opt-radio-icon::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #070b19;
  border-radius: 50%;
}

.opt-text-label {
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.5;
}

.btn-finish-exam {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(135deg, var(--accent-green), #00b0ff);
  border: none;
  border-radius: 16px;
  color: #070b19;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 230, 118, 0.3);
  transition: all 0.3s;
}

.btn-finish-exam:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 230, 118, 0.5);
}

/* RESULTADOS OFICIALES */
.results-hero-card {
  border-radius: 24px;
  padding: 3rem;
  text-align: center;
  backdrop-filter: blur(20px);
  margin-bottom: 2.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.results-hero-card.apto {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(7, 11, 25, 0.85));
  border: 2px solid var(--accent-green);
}

.results-hero-card.no-apto {
  background: linear-gradient(135deg, rgba(255, 56, 96, 0.15), rgba(7, 11, 25, 0.85));
  border: 2px solid #ff3860;
}

.results-hero-card h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.results-hero-card.apto h2 { color: var(--accent-green); }
.results-hero-card.no-apto h2 { color: #ff3860; }

.results-conditions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

.condition-pill-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.2rem;
}

.condition-pill-card.passed {
  border-color: rgba(0, 230, 118, 0.4);
}

.condition-pill-card.failed {
  border-color: rgba(255, 56, 96, 0.5);
  background: rgba(255, 56, 96, 0.06);
}

.condition-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.condition-score {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

/* Ranking de Preguntas de Oro */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ranking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem 1.8rem;
  backdrop-filter: blur(14px);
  transition: all 0.3s ease;
}

.ranking-card:hover {
  border-color: var(--primary-cyan);
  transform: translateY(-2px);
}

.ranking-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.ranking-rep-tag {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
}

.ranking-tema-tag {
  color: var(--primary-cyan);
  font-size: 0.85rem;
  font-weight: 600;
}

.ranking-card p {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.ranking-convocatorias-list {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   OPTIMIZACIONES MÓVILES PARA TARJETAS DE REPASO Y SELECTORES
   ========================================================================== */
@media (max-width: 768px) {
  .flashcard-container {
    padding: 0 0.5rem;
    margin: 1rem auto;
  }

  .flashcard-3d, .flashcard-inner, .flashcard-front {
    min-height: auto;
  }

  .flashcard-front, .flashcard-back {
    padding: 1.4rem 1rem;
    border-radius: 16px;
  }

  .card-q-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .fc-quiz-opt {
    padding: 0.75rem 0.9rem;
    gap: 10px;
  }

  .fc-quiz-opt .opt-letter {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .fc-quiz-opt .opt-text {
    font-size: 0.9rem;
  }

  #fcFilterCarmRow {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  #selectFcTemaCarm, #selectFcDificultad {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .exam-modes-bar {
    flex-direction: column !important;
    width: 100%;
    gap: 8px !important;
  }

  .exam-tab-btn {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .flashcard-controls {
    flex-direction: row;
    width: 100%;
    gap: 10px;
  }

  .flashcard-controls button {
    flex: 1;
    min-height: 46px;
    font-size: 0.95rem;
  }

  /* Ajustes generales de contenedor y cabeceras en móviles */
  .app-container {
    padding: 1rem 0.8rem;
  }

  .hero-banner {
    padding: 1.5rem 1.2rem;
    border-radius: 16px;
  }

  .hero-content h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 0.92rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem !important;
  }

  .metric-card {
    padding: 1rem 0.8rem;
    border-radius: 14px;
  }

  .metric-num {
    font-size: 1.6rem;
  }

  .exam-header-banner {
    padding: 1.4rem 1.2rem;
    border-radius: 16px;
  }

  .exam-header-info h2 {
    font-size: 1.4rem;
  }

  .convocatoria-card {
    padding: 1.4rem 1rem;
    border-radius: 16px;
  }

  .exam-actions-row {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .exam-actions-row button {
    width: 100%;
  }

  .exam-top-sticky {
    padding: 0.8rem 1rem;
    top: 56px;
  }

  .quiz-card {
    padding: 1.4rem 1rem;
    border-radius: 16px;
  }

  .calculator-card {
    padding: 1.4rem 1rem;
    border-radius: 16px;
  }
}

/* ==========================================================================
   PORTAL PÚBLICO DE PRESENTACIÓN (LANDING INFORMATIVA)
   ========================================================================== */

.portal-hero {
  text-align: center;
  padding: 3.5rem 1.5rem 3rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(79, 172, 254, 0.03));
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  margin-bottom: 3rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.portal-hero-badge {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid var(--primary-cyan);
  color: var(--primary-cyan);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  letter-spacing: 0.5px;
}

.portal-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  margin: 0 auto 1.2rem auto;
  max-width: 850px;
  background: linear-gradient(135deg, #ffffff 40%, var(--primary-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 2.2rem auto;
}

.portal-cta-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn-portal-cta {
  padding: 1rem 2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.portal-disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Cuadrícula de Pilares del Portal */
.portal-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.portal-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.portal-feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-cyan);
  box-shadow: 0 15px 40px rgba(0, 242, 254, 0.15);
}

.portal-feat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.portal-feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #fff;
  margin: 0 0 0.8rem 0;
}

.portal-feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  flex-grow: 1;
  margin-bottom: 1.2rem;
}

.portal-feat-tag {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

/* Banner de Cierre del Portal */
.portal-footer-banner {
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(14, 26, 56, 0.9), rgba(7, 12, 28, 0.95));
  border: 1px solid var(--border-glass);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.portal-footer-banner h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.portal-footer-banner p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   PANTALLA DE SOLICITUD PENDIENTE DE APROBACIÓN
   ========================================================================== */

.pending-card {
  max-width: 580px;
  margin: 3rem auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
}

.pending-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.pending-card h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #fff;
  margin: 0 0 1rem 0;
}

.pending-badge-status {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
}

.pending-desc {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.98rem;
  margin: 1rem 0 2rem 0;
}

.pending-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   PANEL DE ADMINISTRACIÓN Y BOTÓN DE ACCESO
   ========================================================================== */

.nav-admin-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  border: 1px solid #f59e0b;
  color: #fcd34d;
  padding: 0.42rem 0.95rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-admin-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
}

.admin-table-container {
  max-height: 420px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  margin-top: 1rem;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  divide-y: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-user-email {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

.admin-user-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-approve-user {
  background: rgba(0, 230, 118, 0.18);
  border: 1px solid var(--accent-green);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-approve-user:hover {
  background: var(--accent-green);
  color: #041208;
}

.btn-reject-user {
  background: rgba(255, 56, 96, 0.15);
  border: 1px solid #ff3860;
  color: #ff3860;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reject-user:hover {
  background: #ff3860;
  color: #fff;
}

/* ========================================================
   BLOQUES DE JUSTIFICACIÓN Y EXPLICACIÓN DIDÁCTICA
   ======================================================== */
.exam-q-explanation {
  margin-top: 1.2rem;
  padding: 1.1rem 1.4rem;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-left: 4px solid var(--primary-cyan);
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  animation: fadeInExplanation 0.35s ease;
}

.exam-q-explanation-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary-cyan);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fc-explanation-box {
  margin-top: 1.2rem;
  padding: 1rem 1.3rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-left: 4px solid var(--primary-cyan);
  border-radius: 12px;
  font-size: 0.93rem;
  line-height: 1.55;
  color: #f1f5f9;
  text-align: left;
}

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

/* ========================================================
   MEJORAS MÓVILES PARA TARJETAS DE REPASO (FLASHCARDS)
   ======================================================== */
.flashcard-3d {
  -webkit-perspective: 1200px;
  perspective: 1200px;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease;
}

.flashcard-inner {
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.flashcard-front,
.flashcard-back {
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Animaciones de deslizamiento fluido entre tarjetas */
.flashcard-slide-left-out {
  transform: translateX(-40px) scale(0.96) !important;
  opacity: 0 !important;
}

.flashcard-slide-left-in {
  animation: fcSlideLeftIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flashcard-slide-right-out {
  transform: translateX(40px) scale(0.96) !important;
  opacity: 0 !important;
}

.flashcard-slide-right-in {
  animation: fcSlideRightIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fcSlideLeftIn {
  from {
    transform: translateX(45px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes fcSlideRightIn {
  from {
    transform: translateX(-45px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Optimización táctil y visual en pantallas móviles */
@media (max-width: 768px) {
  .flashcard-container {
    padding: 0 0.5rem;
    margin: 1rem auto 2rem auto;
  }

  .flashcard-3d {
    min-height: 480px;
    margin-bottom: 1.2rem;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 1.5rem 1.1rem;
    min-height: 480px;
  }

  .card-q-text {
    font-size: 1.1rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .fc-quiz-opt {
    padding: 0.85rem 1rem;
    gap: 10px;
    touch-action: manipulation;
  }

  .fc-quiz-opt:active {
    transform: scale(0.98);
    background: rgba(0, 242, 254, 0.12);
  }

  .flashcard-controls {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 12px;
    width: 100%;
    max-width: 440px;
    margin: 1rem auto 0 auto;
  }

  .btn-control {
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border-radius: 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-control:active {
    transform: scale(0.96);
  }

  .mobile-swipe-hint {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
  }
}

@media (min-width: 769px) {
  .mobile-swipe-hint {
    display: none;
  }
}

/* ==========================================================================
   TALLER DE CARTA NÁUTICA A PANTALLA COMPLETA & ELEMENTOS SUPERPUESTOS
   ========================================================================== */

/* Cuando la vista de carta está activa, la app se expande al 100% de la pantalla */
body.carta-mode-active {
  overflow: hidden !important;
}

body.carta-mode-active .app-container {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  height: calc(100vh - 65px) !important;
}

body.carta-mode-active #view-carta,
#view-carta:not(.hidden) {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: calc(100vh - 75px) !important;
  position: relative !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Modo Pantalla Completa (Oculta Navbar para aprovechar el 100% de la pantalla) */
body.carta-mode-active.fullscreen-mode .app-navbar {
  display: none !important;
}
body.carta-mode-active.fullscreen-mode .app-container {
  height: 100vh !important;
}

#cartaWorkbenchContainer {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: calc(100vh - 75px) !important;
  position: relative !important;
  overflow: hidden !important;
}

.carta-fullscreen-wrapper {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: calc(100vh - 75px) !important;
  position: relative !important;
  overflow: hidden !important;
  background: #020813 !important;
}

/* El lienzo de la Carta ocupa el 100% de la pantalla */
.carta-viewport-box {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  overflow: hidden !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  background: #030b17 !important;
}

#cartaSvg {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  display: block !important;
  touch-action: none !important;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(0, 242, 254, 0.3); }
  50% { box-shadow: 0 0 22px rgba(0, 242, 254, 0.7); }
  100% { box-shadow: 0 0 10px rgba(0, 242, 254, 0.3); }
}

#cartaSvg:active {
  cursor: grabbing;
}

/* BARRA DE HERRAMIENTAS FLOTANTE SUPERPUESTA EN LA CARTA */
.carta-floating-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(7, 13, 27, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.08);
  pointer-events: auto;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.carta-brand-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  background: linear-gradient(135deg, #ffffff, var(--primary-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.42rem 0.8rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.tool-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(79, 172, 254, 0.25));
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.35);
}

.tool-btn-quick {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 0.32rem 0.6rem;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn-quick:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary-cyan);
}

.tool-btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn-icon:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--primary-cyan);
}

.readout-item {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.32rem 0.65rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

/* CONTROLES Y ACCIONES DEL COMPÁS DE PUNTAS */
.tool-btn-action-green {
  background: linear-gradient(135deg, #00e676, #00b0ff);
  border: 1px solid #ffffff;
  color: #051424;
  padding: 0.38rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.45);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-btn-action-green:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.7);
  background: linear-gradient(135deg, #69f0ae, #40c4ff);
}

.compas-sub-controls {
  background: rgba(0, 230, 118, 0.09);
  border: 1px solid rgba(0, 230, 118, 0.35);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.12);
}

.compas-custom-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.carta-nav-tip {
  font-size: 0.76rem;
  color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.22);
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* BOTÓN DE TOGGLE DEL PANEL DE EJERCICIOS */
.btn-toggle-exercise-panel {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.22), rgba(0, 230, 118, 0.22));
  border: 1px solid var(--primary-cyan);
  color: #fff;
  padding: 0.46rem 0.95rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
}

.btn-toggle-exercise-panel:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.38), rgba(0, 230, 118, 0.38));
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.45);
  transform: translateY(-1px);
}

/* PANEL FLOTANTE DE EJERCICIOS (DRAWER DESPLEGABLE) */
.carta-floating-panel {
  position: absolute;
  top: 130px;
  right: 14px;
  bottom: 20px;
  width: 440px;
  max-width: calc(100vw - 28px);
  z-index: 60;
  background: rgba(9, 17, 36, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 242, 254, 0.12);
  transition: opacity 0.25s ease;
}

.carta-floating-panel.collapsed {
  display: none !important;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.7rem;
}

.panel-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: #fff;
  margin: 0.2rem 0 0 0;
}

.btn-panel-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-panel-close:hover {
  background: rgba(255, 56, 96, 0.2);
  border-color: #ff3860;
  color: #ff3860;
}

/* BOTÓN FLOTANTE PARA REABRIR PANEL CUANDO ESTÁ OCULTO */
.carta-panel-reopen-btn {
  position: absolute;
  top: 130px;
  right: 14px;
  z-index: 44;
  background: rgba(9, 17, 36, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--primary-cyan);
  color: var(--primary-cyan);
  padding: 0.65rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.3);
  transition: all 0.25s ease;
  animation: pulseGlow 2.5s infinite;
}

.carta-panel-reopen-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  color: #fff;
  transform: scale(1.04);
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.3); }
  50% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 242, 254, 0.6); }
}

/* PASTILLA FLOTANTE DE COORDENADAS (ABAJO A LA IZQUIERDA) */
.carta-coords-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 45;
  background: rgba(6, 15, 30, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--primary-cyan);
  border-radius: 20px;
  padding: 0.4rem 1.1rem;
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-cyan);
  letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 242, 254, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

.carta-select-styled {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  margin-top: 0.3rem;
  cursor: pointer;
}

.carta-select-styled option {
  background: #0c1624;
  color: #fff;
}

.carta-problem-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.1rem;
}

.prob-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 8px;
  flex-wrap: wrap;
}

.prob-enunciado {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-main);
  margin-bottom: 1.1rem;
}

.prob-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.1rem;
}

.prob-option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.prob-option-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.prob-option-row.selected {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--primary-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.prob-actions-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.carta-formula-cheat {
  background: rgba(0, 242, 254, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}

.carta-formula-cheat h4 {
  color: var(--primary-cyan);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
}

.carta-formula-cheat ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
}

.carta-formula-cheat code {
  color: #ffd54f;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .carta-floating-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0.5rem;
  }
  .toolbar-section {
    justify-content: center;
  }
  .carta-floating-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 75vh;
    border-radius: 24px 24px 0 0;
  }
  .carta-panel-reopen-btn {
    top: auto;
    bottom: 20px;
    right: 14px;
  }
}

/* ==========================================================================
   SISTEMA DE DOMINIO Y RACHA DE FALLOS (MASTERY PROGRESSION)
   ========================================================================== */
.mastery-progress-container {
  margin: 0.8rem 0;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mastery-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.mastery-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9800, #00e676);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.mastery-meta-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 6px;
}

.fallo-streak-fire {
  color: #ff9800;
  font-weight: 700;
}

.fallo-item.mastered {
  border-color: rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.03);
}

/* ==========================================================================
   RADIOGRAFÍA DE TIEMPO DE ESTUDIO EN EL DASHBOARD
   ========================================================================== */
.topics-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 0.5rem;
}

.topic-time-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.topic-time-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topic-time-pill .pill-topic-name {
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.topic-time-pill .pill-topic-duration {
  color: var(--primary-cyan);
  font-family: monospace;
  font-weight: 700;
  font-size: 0.88rem;
}

.tool-btn-quick {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn-quick:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--primary-cyan);
}

/* ==========================================================================
   HITOS NÁUTICOS Y CONDECORACIONES (MILESTONES)
   ========================================================================== */
.milestones-section-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.8rem;
  margin-top: 2rem;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.milestone-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.milestone-card.unlocked {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.04));
  border-color: rgba(255, 193, 7, 0.4);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.15);
}

.milestone-card.locked {
  opacity: 0.75;
}

.milestone-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.milestone-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.milestone-card.unlocked .milestone-icon-wrap {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid #ffd54f;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.35);
}

.milestone-info h4 {
  margin: 0;
  font-size: 0.98rem;
  color: #fff;
  font-family: var(--font-heading);
}

.milestone-card.unlocked h4 {
  color: #ffd54f;
}

.milestone-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.milestone-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.5rem;
}

.milestone-badge-unlocked {
  color: #ffd54f;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.milestone-badge-locked {
  color: var(--text-muted);
}

/* ==========================================================================
   CUADERNO DE BITÁCORA (REGISTRO OFICIAL EN VIVO)
   ========================================================================== */
.bitacora-section-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.bitacora-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.bitacora-log-list::-webkit-scrollbar {
  width: 6px;
}

.bitacora-log-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.bitacora-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  transition: all 0.2s ease;
}

.bitacora-entry:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.bitacora-icon-badge {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.bitacora-content {
  flex: 1;
}

.bitacora-content-title {
  color: #fff;
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.bitacora-content-desc {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin: 0;
  line-height: 1.4;
}

.bitacora-time-stamp {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ============================================================================
   ESTILOS PARA EL SUPER BANCO 520 DAYPO PER
   ============================================================================ */

.daypo-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.daypo-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.daypo-tag-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.daypo-topic-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
}

.daypo-question-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.daypo-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daypo-opt-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: #f1f5f9;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-body);
}

.daypo-opt-btn:hover:not(:disabled) {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--primary-cyan);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
}

.daypo-opt-btn.correct {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.2), rgba(0, 200, 83, 0.35)) !important;
  border-color: #00e676 !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.3) !important;
}

.daypo-opt-btn.incorrect {
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.2), rgba(213, 0, 0, 0.35)) !important;
  border-color: #ff5252 !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.3) !important;
}

.daypo-opt-btn.disabled {
  opacity: 0.6;
  cursor: default;
}

.daypo-opt-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.daypo-opt-btn.correct .daypo-opt-badge {
  background: #00e676;
  color: #000;
  border-color: #00e676;
}

.daypo-opt-btn.incorrect .daypo-opt-badge {
  background: #ff5252;
  color: #fff;
  border-color: #ff5252;
}

.daypo-opt-text {
  flex: 1;
  line-height: 1.4;
}

.daypo-explanation-card {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid var(--border-glass-hover);
  border-left: 4px solid var(--primary-cyan);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.daypo-explanation-card.is-correct {
  border-left-color: #00e676;
  background: rgba(0, 230, 118, 0.05);
}

.daypo-explanation-card.is-incorrect {
  border-left-color: #ff5252;
  background: rgba(255, 82, 82, 0.05);
}

.daypo-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.daypo-exp-badge {
  font-weight: 700;
  font-size: 0.95rem;
}

.daypo-explanation-card.is-correct .daypo-exp-badge {
  color: #00e676;
}

.daypo-explanation-card.is-incorrect .daypo-exp-badge {
  color: #ff5252;
}

.daypo-exp-title {
  font-weight: 700;
  color: var(--primary-cyan);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.daypo-exp-content {
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.daypo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 15px;
  flex-wrap: wrap;
}

.daypo-jump-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}


