/* ===========================================================
   novar · MyoFix — Curso Miopía Progresiva
   =========================================================== */

:root {
  --brand: #2bbbcb;          /* cyan principal */
  --brand-strong: #1aa9bb;
  --brand-deep: #2894a5;     /* secundario de íconos */
  --cta: #2e9ca8;            /* botón REALIZAR TEST / pill */
  --cta-strong: #277f8a;
  --ink: #173a53;            /* títulos navy */
  --ink-soft: #2a4961;
  --muted: #6e7a86;          /* texto cuerpo */
  --footer-bg: #f4f7f9;
  --card-shadow: 0 18px 40px -22px rgba(23, 58, 83, .28);
  --card-shadow-hover: 0 26px 55px -20px rgba(23, 58, 83, .38);
  --nav-grad: linear-gradient(95deg, #6fcfdd 0%, #38bdd0 55%, #2fb5c8 100%);
  --feat-grad: linear-gradient(95deg, #eafafb 0%, #bdeef2 38%, #34c2d2 100%);
  --action-grad: linear-gradient(135deg, #31c4d2 0%, #2094a6 100%);
  --action-grad-strong: linear-gradient(135deg, #1faebf 0%, #177f91 100%);
  --action-shadow: 0 16px 28px -16px rgba(23, 58, 83, .55), inset 0 1px 0 rgba(255, 255, 255, .28);
  --action-shadow-hover: 0 22px 36px -18px rgba(23, 58, 83, .68), inset 0 1px 0 rgba(255, 255, 255, .32);
  --focus-ring: rgba(23, 58, 83, .32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: 'Mulish', system-ui, sans-serif;
  color: var(--ink-soft);
  background: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; color: var(--ink); }

.container { max-width: 1240px; }

/* ============================ NAVBAR ============================ */
.site-nav {
  background: var(--nav-grad);
  padding: .85rem 0;
  transition: padding .3s ease, box-shadow .3s ease;
}
.site-nav.scrolled {
  padding: .5rem 0;
  box-shadow: 0 8px 24px -12px rgba(23, 58, 83, .45);
}
.brand-novar {
  display: inline-flex;
  align-items: center;
  padding: 0;
}
.brand-logo {
  display: block;
  width: auto;
  height: 72px;
  transform: translateX(-29px);
}
.site-nav.scrolled .brand-logo { height: 72px; }
.site-nav .nav-link {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .92) !important;
  padding: .35rem .85rem !important;
  position: relative;
  transition: color .2s ease;
}
.site-nav .nav-link::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .05rem;
  height: 2px; background: #fff; transform: scaleX(0); transform-origin: center;
  transition: transform .28s ease;
}
.site-nav .nav-link:hover::after,
.site-nav .nav-link.active::after { transform: scaleX(1); }
.site-nav .nav-link.active { font-weight: 700; color: #fff !important; }

.lang-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .12); color: #fff;
  font-family: 'Poppins', sans-serif; font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; padding: .48rem 1.05rem; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  cursor: pointer; transition: background .22s ease, color .22s ease, transform .15s ease, box-shadow .22s ease;
}
.lang-pill:hover { background: #fff; color: var(--cta); box-shadow: 0 14px 24px -18px rgba(23, 58, 83, .55); }
.lang-pill:active { transform: scale(.96); }
.lang-pill svg { transition: transform .2s ease; }
.lang-pill:hover svg { transform: rotate(12deg); }

.navbar-toggler { border: none; padding: .4rem; }
.navbar-toggler:focus { box-shadow: none; }
.toggler-bar { display: block; width: 26px; height: 2.5px; background: #fff; border-radius: 3px; margin: 5px 0; transition: .3s; }

/* ============================ HERO ============================ */
.hero { padding: 130px 0 70px; position: relative; }
.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 2.4rem; letter-spacing: .03em; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs span { margin: 0 .2rem; }

.hero-title {
  font-weight: 700; font-size: clamp(2.2rem, 4vw, 3.3rem);
  line-height: 1.08; letter-spacing: -.01em; margin-bottom: 1.6rem;
}
.hero-lead { font-size: 1.02rem; color: var(--muted); max-width: 30rem; margin-bottom: 1.1rem; }
.hero-lead strong { color: var(--ink-soft); font-weight: 700; }
.hero-sub { font-size: 1.02rem; color: var(--muted); max-width: 30rem; }

.hero-image-section {
  padding: 130px 0 0;
  overflow: hidden;
}
.hero-image-section .breadcrumbs { margin-bottom: 1.1rem; }
.hero-image-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
}
.hero-image {
  display: block;
  width: 100%;
  height: auto;
}
.hero-access-btn,
.hero-access-btn:visited {
  position: absolute;
  left: 11.1%;
  top: 69.6%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(124px, 10.5vw, 176px);
  min-height: clamp(48px, 4.1vw, 64px);
  padding: .8rem 1.65rem;
  border-radius: 10px;
  background: #16b9c7;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: clamp(.95rem, 1.45vw, 1.35rem);
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 16px 26px -18px rgba(23, 58, 83, .65);
  transition: transform .18s ease, background .22s ease, box-shadow .22s ease;
}
.hero-access-btn:hover {
  background: #11aebc;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -20px rgba(23, 58, 83, .75);
}
.hero-access-btn:active { transform: translateY(0); }
.hero-access-btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  perspective: 1400px;
  min-height: 390px;
  padding-bottom: 58px;
}
.hero-banner-image {
  display: block;
  width: min(118%, 760px);
  max-width: none;
  height: auto;
  margin-left: auto;
  object-fit: contain;
}
.laptop {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  animation: float 6s ease-in-out infinite;
}
.laptop-screen {
  background: linear-gradient(160deg, #14242f, #25424f);
  border: 10px solid #0e1a22; border-radius: 16px 16px 4px 4px;
  padding: 26px; box-shadow: var(--card-shadow);
  position: relative; aspect-ratio: 16 / 8.8;
}
.laptop-screen::before {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: #33505d;
}
.laptop-base {
  height: 14px; width: 108%; margin-left: -4%;
  background: linear-gradient(#cfd8dd, #aab6bd);
  border-radius: 0 0 14px 14px; box-shadow: 0 14px 22px -12px rgba(23, 58, 83, .5);
}
.laptop-base::after {
  content: ""; display: block; width: 18%; height: 5px; margin: 0 auto;
  background: #95a3aa; border-radius: 0 0 7px 7px;
}

.stat-card { background: #fff; border-radius: 12px; height: 100%; padding: 20px 22px; display: flex; align-items: center; justify-content: center; }
.stat-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.1rem, 2.7vw, 2.2rem);
  width: 100%;
}
.stat-percent {
  flex: 0 0 auto;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  line-height: .86;
  color: var(--brand);
  letter-spacing: 0;
}
.stat-description {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.25vw, 2.05rem);
  line-height: 1.08;
  color: rgba(43, 187, 203, .84);
}
.stat-top { color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: lowercase; margin: 0 0 .1rem; }
.stat-big { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.3rem); color: var(--brand); line-height: 1; }
.stat-mid { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .66rem; letter-spacing: .14em; color: var(--ink); margin: .35rem 0 0; }
.stat-years { font-size: .64rem; letter-spacing: .14em; color: var(--brand-deep); font-weight: 700; margin: .15rem 0 .7rem; }
.people {
  display: flex; gap: 2px; align-items: flex-end;
  flex-shrink: 0;
  margin-bottom: .8rem; height: 20px; overflow: hidden;
}
.people svg { width: 9px; height: 18px; flex: 0 0 auto; }
.people .is-myope { color: var(--brand); }
.people .is-rest { color: #cfe6ea; }
.progress-line { height: 7px; flex-shrink: 0; background: #e4eef0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); border-radius: 99px; transition: width 1.4s cubic-bezier(.16,.84,.34,1); }
.stat-foot { font-size: .66rem; color: var(--muted); margin: .45rem 0 0; }
.stat-foot b { color: var(--ink); }

.glasses {
  position: absolute; bottom: -8px; left: -2%; z-index: 2;
  width: min(56%, 380px); height: auto;
  pointer-events: none;
  filter: drop-shadow(0 18px 18px rgba(43, 187, 203, .26));
  animation: float 6s ease-in-out infinite .6s;
}

/* ============================ FEATURES ============================ */
.features { background: var(--feat-grad); padding: 64px 0 72px; }
.section-title {
  position: relative; color: var(--brand-deep);
  font-weight: 600; font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  letter-spacing: .04em; margin-bottom: 3rem; padding-bottom: .9rem;
}
.title-underline { position: absolute; left: 0; bottom: 0; width: 64px; height: 3px; background: var(--brand-deep); border-radius: 3px; }

.features-grid { max-width: 1000px; }
.feature { display: flex; align-items: center; gap: 1.1rem; }
.feature-icon { width: 58px; height: 58px; flex-shrink: 0; transition: transform .35s ease; }
.feature:hover .feature-icon { transform: translateY(-4px) scale(1.06); }
.feature p { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 500; color: var(--ink); font-size: 1.02rem; line-height: 1.28; }

/* ============================ PROGRAMA ============================ */
.program { background: #fff; padding: 70px 0; }
.program-card {
  background: #fff; border-radius: 34px; padding: clamp(1.4rem, 4vw, 3.4rem);
  box-shadow: 0 30px 70px -40px rgba(23, 58, 83, .35);
  border: 1px solid #eef3f5;
}
.program-title { font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--ink); position: relative; padding-bottom: 1rem; margin-bottom: 2.6rem; }

.modules { display: flex; flex-direction: column; gap: 1.5rem; }
.module {
  display: grid; grid-template-columns: 190px 1fr auto; align-items: center; gap: 1.6rem;
  background: #fff; border: 1px solid #eef2f4; border-radius: 18px;
  padding: 1.6rem 2rem; box-shadow: var(--card-shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.module:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.module-num {
  font-family: 'Poppins', sans-serif; font-weight: 700;
  font-size: 1.9rem; color: var(--brand);
  border-right: 1px solid #e3eaee; padding-right: 1.4rem; line-height: 1;
}
.module-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0 0 .5rem; }
.module-body p { font-size: .92rem; color: var(--muted); margin: 0; line-height: 1.5; }

.btn-course, .btn-test, .btn-course:visited, .btn-test:visited {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; min-width: 132px;
  font-family: 'Poppins', sans-serif; font-weight: 700; letter-spacing: .06em;
  text-decoration: none; border-radius: 8px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .24);
  overflow: hidden; isolation: isolate;
  transition: transform .18s ease, box-shadow .24s ease, background .24s ease, border-color .24s ease;
}
.btn-course:visited,
.btn-test:visited,
.btn-quiz:visited { color: #fff; }
.btn-quiz.ghost:visited { color: var(--cta-strong); }
.btn-course::before,
.btn-test::before {
  content: ""; position: absolute; inset: 1px auto 1px 1px; width: 38%;
  background: linear-gradient(90deg, rgba(255,255,255,.24), rgba(255,255,255,0));
  border-radius: 7px 0 0 7px; opacity: .85; z-index: 0; pointer-events: none;
  transition: opacity .2s ease, transform .24s ease;
}
.btn-course::after,
.btn-test::after {
  content: ""; width: .48rem; height: .48rem; margin-left: .78rem;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease;
}
.btn-course {
  background: var(--action-grad); color: #fff; font-size: .8rem;
  padding: .75rem 1.35rem .75rem 1.55rem; box-shadow: var(--action-shadow);
}
.btn-course:hover {
  background: var(--action-grad-strong); color: #fff; transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .42); box-shadow: var(--action-shadow-hover);
}
.btn-course:hover::before,
.btn-test:hover::before { opacity: 1; transform: translateX(8px); }
.btn-course:hover::after,
.btn-test:hover::after { transform: translateX(3px) rotate(45deg); }
.btn-course:active { transform: translateY(0); }
.btn-course:focus-visible,
.btn-test:focus-visible,
.btn-quiz:focus-visible,
.lang-pill:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ============================ CTA TEST ============================ */
.cta-test { background: #fff; padding: 20px 0 80px; }
.cta-divider { display: flex; align-items: center; gap: 1.5rem; }
.cta-divider .line { flex: 1; height: 1px; background: #c9d4d8; }
.btn-test {
  background: linear-gradient(135deg, var(--ink) 0%, var(--cta) 100%);
  color: #fff; font-size: .9rem;
  padding: .9rem 2rem .9rem 2.2rem; box-shadow: 0 18px 34px -18px rgba(23, 58, 83, .68), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-test:hover {
  background: linear-gradient(135deg, #102f46 0%, var(--cta-strong) 100%);
  transform: translateY(-2px); color: #fff;
  border-color: rgba(255, 255, 255, .4); box-shadow: 0 24px 42px -20px rgba(23, 58, 83, .76), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-test:active { transform: translateY(0); }

/* ============================ FOOTER ============================ */
.site-footer { background: var(--footer-bg); padding: 60px 0 50px; }
.brand-myofix { display: inline-flex; align-items: center; }
.footer-logo { display: block; width: 205px; max-width: 100%; height: auto; }
.footer-text { color: var(--muted); font-size: .92rem; max-width: 24rem; margin-top: 1.2rem; line-height: 1.55; }

.footer-links { list-style: none; padding: 0; margin: .3rem 0 0; }
.footer-links li { margin-bottom: .85rem; }
.footer-links a {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .8rem;
  letter-spacing: .06em; color: var(--ink); text-decoration: none; transition: color .2s ease;
}
.footer-links a:hover { color: var(--brand); }

.footer-head { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .82rem; letter-spacing: .08em; color: var(--ink); margin-bottom: 1.1rem; }
.socials { display: flex; gap: .65rem; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid #d3dde1;
  color: var(--ink); transition: all .22s ease;
}
.socials a:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-3px); }

/* ============================ ANIMATIONS ============================ */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,.84,.34,1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .laptop, .glasses { animation: none; }
  .btn-course, .btn-test, .btn-quiz, .lang-pill,
  .btn-course::before, .btn-test::before, .btn-quiz::before,
  .btn-course::after, .btn-test::after, .btn-quiz svg { transition: none; }
  .btn-course:hover, .btn-test:hover, .btn-quiz:hover { transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 991.98px) {
  .site-nav { background: var(--nav-grad); }
  .navbar-collapse { margin-top: .8rem; padding-bottom: .6rem; }
  .site-nav .nav-link { padding: .5rem .2rem !important; }
  .hero { padding-top: 110px; }
  .hero-visual { justify-content: center; min-height: 360px; padding-bottom: 54px; }
  .hero-banner-image {
    width: min(100%, 620px);
    max-width: 100%;
    margin: 0 auto;
  }
  .laptop { max-width: 540px; margin: 0 auto; }
  .glasses { left: 1%; bottom: -4px; width: min(54%, 330px); }
}
@media (max-width: 767.98px) {
  .module { grid-template-columns: 1fr; gap: .8rem; text-align: left; padding: 1.4rem 1.4rem; }
  .module-num { border-right: none; border-bottom: 1px solid #e3eaee; padding: 0 0 .7rem; }
  .btn-course { justify-self: start; }
  .btn-course, .btn-test, .btn-quiz { min-height: 48px; }
  .feature { justify-content: flex-start; }
  .cta-divider .line { display: none; }
  .cta-divider { justify-content: center; }
}
@media (max-width: 575.98px) {
  .hero-row { --bs-gutter-x: 0; }
  .hero-image-wrap { height: 470px; }
  .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 12% center;
  }
  .hero-access-btn,
  .hero-access-btn:visited {
    left: 9.8%;
    top: 67.8%;
    min-width: 112px;
    min-height: 42px;
    padding: .7rem 1.15rem;
    border-radius: 8px;
    font-size: .9rem;
  }
  .hero-visual { min-height: 300px; padding-bottom: 44px; }
  .laptop { max-width: 92%; }
  .laptop-screen { border-width: 8px; padding: 16px; }
  .laptop-base { height: 12px; }
  .stat-card { padding: 14px 16px; }
  .stat-result { gap: .85rem; }
  .stat-percent { font-size: clamp(2.55rem, 15vw, 4.1rem); }
  .stat-description { font-size: clamp(.82rem, 5vw, 1.35rem); line-height: 1.05; }
  .stat-top { font-size: .58rem; }
  .stat-big { font-size: clamp(1.3rem, 8vw, 1.9rem); }
  .stat-mid { font-size: .52rem; }
  .stat-years { font-size: .52rem; margin-bottom: .5rem; }
  .people { height: 16px; margin-bottom: .55rem; }
  .people svg { width: 7px; height: 14px; }
  .progress-line { height: 6px; }
  .stat-foot { font-size: .54rem; }
  .glasses { left: 0; bottom: 2px; width: min(58%, 260px); }
}

/* ===========================================================
   PÁGINA DE MÓDULOS (modulos.html)
   =========================================================== */

/* ---- Hero compacto ---- */
.mod-hero { padding: 130px 0 40px; background: var(--feat-grad); }
.mod-hero .breadcrumbs { color: var(--ink-soft); margin-bottom: 1.6rem; }
.mod-hero .breadcrumbs a { color: var(--ink-soft); }
.mod-hero .breadcrumbs a:hover { color: var(--ink); }
.mod-hero-title {
  font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.1; margin-bottom: .9rem;
}
.mod-hero-lead { font-size: 1.02rem; color: var(--ink-soft); max-width: 40rem; margin: 0; }
.mod-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.mod-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255, 255, 255, .65); border: 1px solid rgba(23, 58, 83, .12);
  color: var(--ink); font-family: 'Poppins', sans-serif; font-weight: 600;
  font-size: .76rem; letter-spacing: .03em; padding: .45rem .9rem; border-radius: 999px;
}
.mod-chip svg { width: 16px; height: 16px; stroke: var(--brand-deep); }

/* ---- Layout 2 columnas ---- */
.mod-layout { padding: 48px 0 30px; }
.mod-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2.4rem; align-items: start; }
.mod-grid > * { min-width: 0; }

/* ---- Sidebar de navegación (scroll-spy) ---- */
.mod-aside { position: sticky; top: 96px; }
.mod-aside-title {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .76rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brand-deep);
  margin: 0 0 1rem .2rem;
}
.mod-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.mod-toc a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .8rem; border-radius: 12px; text-decoration: none;
  color: var(--ink-soft); font-family: 'Poppins', sans-serif; font-weight: 500;
  font-size: .86rem; line-height: 1.25; transition: background .2s ease, color .2s ease;
  border: 1px solid transparent;
}
.mod-toc a .toc-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e7f4f6; color: var(--brand-deep); font-weight: 700; font-size: .78rem;
  transition: background .2s ease, color .2s ease;
}
.mod-toc a:hover { background: #f0f8f9; color: var(--ink); }
.mod-toc a.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 10px 22px -12px rgba(43, 187, 203, .8); }
.mod-toc a.active .toc-num { background: rgba(255, 255, 255, .25); color: #fff; }
.mod-toc .toc-test a { margin-top: .4rem; }
.mod-toc .toc-test .toc-num { background: #fdeef0; color: #d65a6a; }
.mod-toc .toc-test a.active { background: var(--cta); border-color: var(--cta); box-shadow: 0 10px 22px -12px rgba(46, 156, 168, .8); }
.mod-toc .toc-test a.active .toc-num { background: rgba(255, 255, 255, .25); color: #fff; }

/* ---- Tarjetas de módulo + video ---- */
.mod-content { display: flex; flex-direction: column; gap: 2.2rem; min-width: 0; }
.mod-card {
  background: #fff; border: 1px solid #eef2f4; border-radius: 22px;
  padding: clamp(1.3rem, 3vw, 2.2rem); box-shadow: var(--card-shadow);
  scroll-margin-top: 96px;
}
.mod-card-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.3rem; }
.mod-badge {
  flex: 0 0 auto; font-family: 'Poppins', sans-serif; font-weight: 700;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(95deg, var(--brand), var(--brand-deep)); color: #fff;
  padding: .45rem .85rem; border-radius: 999px;
}
.mod-card-head h2 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 700; margin: .1rem 0 0; line-height: 1.2; }
.mod-card-desc { color: var(--muted); font-size: .96rem; line-height: 1.6; margin: 0 0 1.4rem; }

.video-shell {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #0e1a22; aspect-ratio: 16 / 9;
  box-shadow: 0 20px 44px -26px rgba(23, 58, 83, .55);
}
.video-shell + .video-shell { margin-top: 1.4rem; }
.video-shell video { width: 100%; height: 100%; display: block; background: #0e1a22; }
.video-label {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .82rem;
  color: var(--ink); margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem;
}
.video-label svg { width: 17px; height: 17px; stroke: var(--brand-deep); flex: 0 0 auto; }

/* ---- Navegación inferior entre módulos ---- */
.mod-foot-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; }
.mod-foot-nav a {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .8rem;
  color: var(--brand-deep); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
  transition: color .2s ease;
}
.mod-foot-nav a:hover { color: var(--ink); }
.mod-foot-nav a svg { width: 16px; height: 16px; }
.mod-foot-nav .spacer { flex: 1; }

/* ===========================================================
   JUEGO DE TEST (quiz)
   =========================================================== */
.quiz-card {
  background: linear-gradient(160deg, #ffffff 0%, #f3fbfc 100%);
  border: 1px solid #dceef1; border-radius: 24px;
  padding: clamp(1.4rem, 3.5vw, 2.6rem);
  box-shadow: 0 30px 70px -40px rgba(23, 58, 83, .4);
  scroll-margin-top: 96px;
}
.quiz-head { text-align: center; margin-bottom: 1.6rem; }
.quiz-head .mod-badge { background: linear-gradient(95deg, #f2748a, #d65a6a); }
.quiz-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; margin: 1rem 0 .4rem; }
.quiz-sub { color: var(--muted); font-size: .95rem; margin: 0; }

/* barra de progreso */
.quiz-progress-wrap { margin: 1.6rem 0 1.8rem; }
.quiz-progress-info {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Poppins', sans-serif; font-size: .8rem; font-weight: 600;
  color: var(--ink-soft); margin-bottom: .5rem;
}
.quiz-progress-info .q-score { color: var(--brand-deep); }
.quiz-progress { height: 8px; background: #e4eef0; border-radius: 99px; overflow: hidden; }
.quiz-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); border-radius: 99px; transition: width .4s cubic-bezier(.16,.84,.34,1); }

/* pregunta */
.quiz-question {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--ink); line-height: 1.35; margin: 0 0 1.4rem;
}
.quiz-options { display: flex; flex-direction: column; gap: .75rem; }
.quiz-option {
  display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid #dde7ea; border-radius: 14px;
  padding: 1rem 1.2rem; cursor: pointer; font-family: 'Mulish', sans-serif;
  font-size: .98rem; color: var(--ink-soft); line-height: 1.4;
  transition: border-color .2s ease, background .2s ease, transform .12s ease, box-shadow .2s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 8px 20px -14px rgba(43, 187, 203, .8); transform: translateY(-1px); }
.quiz-option:active:not(:disabled) { transform: translateY(0) scale(.995); }
.quiz-option:focus-visible { outline: 3px solid rgba(43, 187, 203, .45); outline-offset: 2px; }
.quiz-option .opt-key {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef5f6; color: var(--brand-deep); font-family: 'Poppins', sans-serif;
  font-weight: 700; font-size: .9rem; transition: background .2s ease, color .2s ease;
}
.quiz-option .opt-mark { margin-left: auto; flex: 0 0 auto; width: 22px; height: 22px; opacity: 0; transition: opacity .2s ease; }
.quiz-option:disabled { cursor: default; }

/* estados de respuesta */
.quiz-option.correct { border-color: #34b27b; background: #effaf3; color: #1c7a52; }
.quiz-option.correct .opt-key { background: #34b27b; color: #fff; }
.quiz-option.correct .opt-mark { opacity: 1; color: #34b27b; }
.quiz-option.wrong { border-color: #e0697a; background: #fdeef0; color: #b13d4e; }
.quiz-option.wrong .opt-key { background: #e0697a; color: #fff; }
.quiz-option.wrong .opt-mark { opacity: 1; color: #e0697a; }
.quiz-option.dimmed { opacity: .55; }

/* feedback + acciones */
.quiz-feedback {
  margin-top: 1.2rem; padding: .9rem 1.1rem; border-radius: 12px;
  font-size: .9rem; font-weight: 600; font-family: 'Poppins', sans-serif;
  display: none; align-items: center; gap: .6rem;
  min-width: 0; overflow-wrap: anywhere;
}
.quiz-feedback.show { display: flex; }
.quiz-feedback.ok { background: #effaf3; color: #1c7a52; }
.quiz-feedback.no { background: #fdeef0; color: #b13d4e; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.btn-quiz {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 46px; min-width: 136px;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .86rem; letter-spacing: .04em;
  background: var(--action-grad); color: #fff; border: 1px solid rgba(255, 255, 255, .24); cursor: pointer;
  padding: .8rem 1.55rem; border-radius: 8px; text-decoration: none;
  box-shadow: var(--action-shadow);
  overflow: hidden; isolation: isolate;
  transition: transform .18s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease, border-color .2s ease;
}
.btn-quiz::before {
  content: ""; position: absolute; inset: 1px auto 1px 1px; width: 38%;
  background: linear-gradient(90deg, rgba(255,255,255,.22), rgba(255,255,255,0));
  border-radius: 7px 0 0 7px; z-index: 0; pointer-events: none;
  transition: transform .24s ease, opacity .2s ease;
}
.btn-quiz svg { flex: 0 0 auto; transition: transform .2s ease; }
.btn-quiz:hover {
  background: var(--action-grad-strong); transform: translateY(-2px); color: #fff;
  border-color: rgba(255, 255, 255, .42); box-shadow: var(--action-shadow-hover);
}
.btn-quiz:hover::before { transform: translateX(8px); opacity: 1; }
.btn-quiz:hover svg { transform: translateX(2px); }
.btn-quiz:active { transform: translateY(0); }
.btn-quiz[disabled] {
  background: #d7e6ea; color: #637d87; border-color: #d7e6ea;
  cursor: not-allowed; transform: none; box-shadow: none; opacity: 1;
}
.btn-quiz[disabled]::before { display: none; }
.btn-quiz.ghost {
  background: #fff; color: var(--cta-strong); box-shadow: inset 0 0 0 1px rgba(46, 156, 168, .45);
  border-color: rgba(46, 156, 168, .42);
}
.btn-quiz.ghost::before { background: linear-gradient(90deg, rgba(43,187,203,.12), rgba(43,187,203,0)); }
.btn-quiz.ghost:hover { background: #effafb; color: var(--ink); border-color: var(--brand); }

/* pantalla de resultado */
.quiz-result { text-align: center; display: none; }
.quiz-result.show { display: block; }
.result-ring { position: relative; width: 168px; height: 168px; margin: .5rem auto 1.4rem; }
.result-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.result-ring .ring-bg { fill: none; stroke: #e4eef0; stroke-width: 12; }
.result-ring .ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.16,.84,.34,1); }
.result-ring .ring-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.result-ring .ring-pct { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 2.2rem; color: var(--ink); line-height: 1; }
.result-ring .ring-label { font-size: .72rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; margin-top: .3rem; }
.result-headline { font-size: 1.5rem; font-weight: 700; margin: 0 0 .5rem; }
.result-detail { color: var(--muted); font-size: 1rem; margin: 0 auto 1.8rem; max-width: 30rem; }
.result-detail b { color: var(--ink); }
.quiz-result .quiz-actions { justify-content: center; gap: .8rem; flex-wrap: wrap; }

/* ---- Responsive página módulos ---- */
@media (max-width: 991.98px) {
  .mod-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .mod-aside {
    position: static; top: auto;
    background: #fff; border: 1px solid #eef2f4; border-radius: 18px;
    padding: 1.1rem; box-shadow: var(--card-shadow);
  }
  .mod-toc { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .5rem; padding-bottom: .3rem; -webkit-overflow-scrolling: touch; }
  .mod-toc a { white-space: nowrap; }
  .mod-toc a span:not(.toc-num) { display: none; }
  .mod-toc a .toc-num { width: 30px; height: 30px; }
  .mod-toc .toc-test a { margin-top: 0; }
  .mod-hero { padding-top: 110px; }
}
@media (max-width: 575.98px) {
  .mod-layout .container { width: 100%; max-width: 100%; }
  .mod-aside, .mod-content, .mod-card, .quiz-card { width: 100%; max-width: 100%; min-width: 0; }
  .mod-toc { max-width: 100%; min-width: 0; }
  .quiz-question, .quiz-option, .result-detail { overflow-wrap: anywhere; }
  .mod-card-head { flex-direction: column; gap: .7rem; }
  .quiz-option { font-size: .92rem; padding: .85rem 1rem; gap: .7rem; }
  .quiz-actions, .quiz-result .quiz-actions { justify-content: stretch; }
  .btn-quiz { flex: 1; max-width: 100%; }
}
