@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");

/* Por módulo */
#por-modulo {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modulos-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.modulos-header-top h2 {
  margin: 0 0 8px 0;
}

.modulos-header-top p {
  margin: 0;
  max-width: 760px;
}

#btn-modulos-toggle {
  min-width: 200px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 2px solid rgba(79, 124, 244, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.35), 0 0 18px rgba(124, 244, 224, 0.45);
  text-shadow: 0 1px 8px rgba(0,0,0,0.18);
  border-radius: 999px;
}

#btn-modulos-toggle:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(79, 124, 244, 0.45), 0 0 22px rgba(124, 244, 224, 0.6);
}

#btn-modulos-toggle:active {
  transform: translateY(0) scale(0.995);
}

.modulos-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 10px 12px 12px 12px;
  box-shadow: var(--shadow-soft);
  display: none;
}

.modulos-panel.open {
  display: block;
}

#por-modulo .modulo {
  border-left: 4px solid var(--color-accent);
  padding: 18px 18px 16px 18px;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

#por-modulo .modulo h3 {
  margin-top: 0;
}

#por-modulo details {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.01);
  transition: border-color var(--transition), box-shadow var(--transition);
}

#por-modulo details:hover {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 236, 0.12);
}

#por-modulo summary {
  list-style: none;
  cursor: pointer;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

#por-modulo summary::-webkit-details-marker {
  display: none;
}

#por-modulo summary::before {
  content: "▸";
  color: var(--color-accent-strong);
  transition: transform var(--transition);
  font-size: 0.9rem;
}

#por-modulo details[open] summary::before {
  transform: rotate(90deg);
}

#por-modulo details p {
  margin-top: 8px;
}

/* Root variables */
:root {
  --color-bg: #f4f6fb;
  --color-bg-alt: #ffffff;
  --color-bg-hover: #f8f9fc;
  --color-surface: rgba(255, 255, 255, 0.78);
  --color-text: #0f172a;
  --color-muted: #556079;
  --color-border: #d6d9e4;
  --color-accent: #2563eb;
  --color-accent-strong: #1d4ed8;
  --color-accent-soft: rgba(37, 99, 235, 0.12);
  --color-amber: #f59e0b;
  --color-primary: #4f7cf4;
  --radius: 14px;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.09);
  --transition: 180ms ease;
  --max-width: 1200px;
  --header-height: 80px;
  --gradient-hero: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.16), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(29, 78, 216, 0.12));
  --glass: backdrop-filter: blur(16px);
}

body.dark-mode {
  --color-bg: #0b1220;
  --color-bg-alt: #101a2c;
  --color-bg-hover: #1a2332;
  --color-surface: rgba(17, 24, 39, 0.78);
  --color-text: #e6edf7;
  --color-muted: #9fb1c6;
  --color-border: #22314a;
  --color-accent: #82b4ff;
  --color-accent-strong: #5b8ddf;
  --color-primary: #82b4ff;
  --color-accent-soft: rgba(130, 180, 255, 0.16);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.35);
  --gradient-hero: radial-gradient(circle at 18% 18%, rgba(130, 180, 255, 0.18), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(245, 158, 11, 0.14), transparent 32%),
    linear-gradient(135deg, rgba(16, 24, 40, 0.9), rgba(12, 17, 26, 0.94));
}

/* Global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(37, 99, 235, 0.05));
  opacity: 1;
  z-index: -2;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
  color: var(--color-accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-strong);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 28px) 24px 76px;
}

section {
  margin-bottom: 48px;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: 2.6rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.65rem;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.1rem;
  margin: 12px 0 8px;
}

p {
  margin: 0 0 12px;
  color: var(--color-muted);
}

ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--color-muted);
}

button {
  font: inherit;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

button:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.container-wide {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

/* Header */
#top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.header-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: blur(8px);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.logo-link:hover {
  border-color: var(--color-border);
  background: var(--color-bg-alt);
  transform: translateY(-1px);
}

.logo-link img {
  height: 46px;
  width: auto;
  display: block;
}

/* Slightly larger main Smart-2U logo (header/footer) */
.logo-link img[src*="smart-2u_logo_sin_fondo"] {
  height: 58px;
}

.logo-text {
  font-weight: 700;
  color: var(--color-text);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}

.main-nav a {
  color: var(--color-text);
  padding: 8px 10px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--color-accent-strong);
  background: rgba(31, 122, 236, 0.1);
  box-shadow: inset 0 -2px 0 var(--color-accent);
  transform: translateY(-1px);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hero */
#hero {
  padding: 54px 38px 44px;
  margin-top: 10px;
  background: var(--gradient-hero);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
  position: relative;
  overflow: hidden;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-content {
  position: relative;
  z-index: 1;
}

#hero h1 {
  margin-bottom: 12px;
  font-size: 2.8rem;
}

#hero p {
  max-width: 820px;
  margin-bottom: 18px;
}

.hero-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-text);
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-weight: 600;
}

.hero-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 20px;
}

.hero-search label {
  font-weight: 600;
  color: var(--color-text);
}

.hero-search input[type="search"] {
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-size: 1.02rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.hero-search input[type="search"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.hero-search-caption {
  font-weight: 700;
  color: var(--color-text);
  opacity: 0.92;
}

.hero-bot-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 244, 224, 0.12));
  color: var(--color-text);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.2), 0 0 28px rgba(124, 244, 224, 0.25);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background 220ms ease;
}

.hero-bot-cta:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 22px 46px rgba(37, 99, 235, 0.28), 0 0 32px rgba(124, 244, 224, 0.35);
  border-color: rgba(37, 99, 235, 0.45);
}

.hero-bot-cta:active {
  transform: translateY(0) scale(0.995);
}

.hero-bot-cta .cta-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 6px 14px rgba(37, 99, 235, 0.35));
}

.hero-bot-cta .cta-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.hero-bot-cta .cta-main {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.1px;
}

.hero-bot-cta .cta-sub {
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.97rem;
}

.hero-bot-cta .cta-glow,
.hero-bot-cta .cta-pulse {
  position: absolute;
  inset: -30% -14%;
  border-radius: 28px;
  background: radial-gradient(circle at 20% 20%, rgba(124, 244, 224, 0.22), transparent 48%),
    radial-gradient(circle at 80% 60%, rgba(37, 99, 235, 0.22), transparent 40%);
  opacity: 0.75;
  pointer-events: none;
  z-index: -1;
}

.hero-bot-cta .cta-pulse {
  animation: pulseGlow 2.6s ease-in-out infinite;
  mix-blend-mode: screen;
}

.hero-bot-cta.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(124, 244, 224, 0.24));
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 24px 52px rgba(37, 99, 235, 0.32), 0 0 38px rgba(124, 244, 224, 0.42);
}

body.dark-mode .hero-bot-cta {
  border-color: rgba(130, 180, 255, 0.28);
  background: linear-gradient(135deg, rgba(130, 180, 255, 0.14), rgba(124, 244, 224, 0.12));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.45), 0 0 28px rgba(124, 244, 224, 0.3);
}

body.dark-mode .hero-bot-cta.active {
  border-color: rgba(130, 180, 255, 0.6);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.55), 0 0 38px rgba(124, 244, 224, 0.5);
}

@keyframes pulseGlow {
  0% { opacity: 0.65; transform: scale(0.98); }
  50% { opacity: 0.85; transform: scale(1.02); }
  100% { opacity: 0.65; transform: scale(0.98); }
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.hero-chips button {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: var(--color-text);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.hero-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-links.primary {
  margin-bottom: 6px;
}

.hero-links.primary a {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.2);
}

.hero-links.primary a:hover {
  color: #fff;
  border-color: var(--color-accent-strong);
  background: var(--color-accent-strong);
}

.hero-links.secondary {
  margin-top: 18px;
}

.hero-links.secondary a {
  min-width: auto;
  padding: 8px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.hero-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
  margin: -8px 0 14px 0;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.hero-links a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.14);
}

.hero-visual {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.thumb-loop {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: #000;
  display: block;
}

.thumb-loop video,
.thumb-loop img {
  width: 100%;
  display: block;
  border-radius: inherit;
}

.logo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.logo-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-soft);
  min-height: 120px;
}

.logo-pill img {
  max-height: 84px;
  width: auto;
}

/* Por problema */
#por-problema {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.objetivos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.objetivos-header h2 {
  margin: 0 0 8px 0;
}

.objetivos-header p {
  margin: 0;
  max-width: 780px;
}

#btn-objetivos-toggle {
  min-width: 200px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 2px solid rgba(79, 124, 244, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.35), 0 0 18px rgba(124, 244, 224, 0.45);
  text-shadow: 0 1px 8px rgba(0,0,0,0.18);
  border-radius: 999px;
}

#btn-objetivos-toggle:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(79, 124, 244, 0.45), 0 0 22px rgba(124, 244, 224, 0.6);
}

#btn-objetivos-toggle:active {
  transform: translateY(0) scale(0.995);
}

.objetivos-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 10px 12px 18px 12px;
  box-shadow: var(--shadow-soft);
  display: none;
}

.objetivos-panel.open {
  display: block;
}

.objetivos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

#por-problema .problema {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  margin: 0;
}

#por-problema .problema details[open] {
  border-color: var(--color-accent);
  box-shadow: 0 10px 26px rgba(31, 122, 236, 0.12);
}

#por-problema .problema:hover {
  transform: translateY(-2px);
}

#por-problema summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  position: relative;
}

#por-problema summary::-webkit-details-marker {
  display: none;
}

#por-problema summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  font-size: 0.9rem;
}

#por-problema details[open] summary::before {
  content: "–";
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: rotate(180deg);
}

#por-problema details {
  padding: 2px 4px 10px;
}

#por-problema details > *:not(summary) {
  padding-left: 4px;
}

#por-problema ul {
  margin: 8px 0 12px 0;
}

.problema-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.problema-meta img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.howto-body {
  margin: 10px 2px 6px;
}

.howto-body h3,
.howto-body h4 {
  margin: 8px 0 6px;
}

.howto-body ol {
  margin: 6px 0 8px 18px;
  color: var(--color-text);
}

.howto-body .ref {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Por módulo */
#por-modulo .modulo {
  border-left: 4px solid var(--color-accent);
  padding: 18px 18px 16px 18px;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

#por-modulo .modulo h3 {
  margin-top: 0;
}

#por-modulo details {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.01);
  transition: border-color var(--transition), box-shadow var(--transition);
}

#por-modulo details:hover {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 236, 0.12);
}

#por-modulo summary {
  list-style: none;
  cursor: pointer;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

#por-modulo summary::-webkit-details-marker {
  display: none;
}

#por-modulo summary::before {
  content: "▸";
  color: var(--color-accent-strong);
  transition: transform var(--transition);
  font-size: 0.9rem;
}

.module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.module-header:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.module-toggle {
  margin-left: auto;
  transition: transform var(--transition);
  font-weight: 600;
  color: var(--color-primary);
}

.module-content {
  padding: 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: 4px;
}

section.modulo {
  margin-bottom: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  overflow: hidden;
}

.module-media {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.module-media img,
.module-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

#por-modulo details[open] summary::before {
  transform: rotate(90deg);
}

#por-modulo details p {
  margin-top: 8px;
}

/* Por rol */
#por-rol {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.roles-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

#btn-roles-toggle {
  min-width: 200px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 2px solid rgba(79, 124, 244, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.35), 0 0 18px rgba(124, 244, 224, 0.45);
  text-shadow: 0 1px 8px rgba(0,0,0,0.18);
}

#btn-roles-toggle:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(79, 124, 244, 0.45), 0 0 22px rgba(124, 244, 224, 0.6);
}

#btn-roles-toggle:active {
  transform: translateY(0) scale(0.995);
}

.roles-header h2 {
  margin: 0 0 8px 0;
}

.roles-header p {
  margin: 0;
  max-width: 640px;
}

.roles-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 6px 10px 18px 10px;
  box-shadow: var(--shadow-soft);
  display: none;
}

.roles-panel.open {
  display: block;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

#por-rol .rol {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rol-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rol-head img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

#por-rol ul {
  padding-left: 18px;
  margin: 0;
}

#por-rol li {
  margin-bottom: 6px;
}

#por-rol a {
  color: var(--color-text);
  font-weight: 600;
}

#por-rol a:hover {
  color: var(--color-accent-strong);
}

/* Implementación */
#implementacion {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#implementacion .implement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

#implementacion .implement-header h2 {
  margin: 0 0 8px 0;
}

#implementacion .implement-header p {
  margin: 0;
  max-width: 680px;
}

#btn-implement-toggle,
#btn-docs-toggle,
#btn-integral-toggle {
  min-width: 200px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 2px solid rgba(79, 124, 244, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.35), 0 0 18px rgba(124, 244, 224, 0.45);
  text-shadow: 0 1px 8px rgba(0,0,0,0.18);
  border-radius: 999px;
}

#btn-implement-toggle:hover,
#btn-docs-toggle:hover,
#btn-integral-toggle:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(79, 124, 244, 0.45), 0 0 22px rgba(124, 244, 224, 0.6);
}

#btn-implement-toggle:active,
#btn-docs-toggle:active,
#btn-integral-toggle:active {
  transform: translateY(0) scale(0.995);
}

#implementacion .implement-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 10px 12px 18px 12px;
  box-shadow: var(--shadow-soft);
  display: none;
}

#implementacion .implement-panel.open {
  display: block;
}

#implementacion .implement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

#implementacion .modelo-imp {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 180ms ease;
}

#implementacion .modelo-imp:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(124, 244, 224, 0.65);
  box-shadow: 0 16px 40px rgba(79, 124, 244, 0.18), 0 0 24px rgba(124, 244, 224, 0.32);
}

body.dark-mode #implementacion .modelo-imp:hover {
  border-color: rgba(124, 244, 224, 0.8);
  box-shadow: 0 16px 40px rgba(10, 163, 255, 0.28), 0 0 32px rgba(124, 244, 224, 0.45);
}

.modelo-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  color: #0b1220;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 12px 26px rgba(79, 124, 244, 0.28), 0 0 18px rgba(124, 244, 224, 0.35);
}

/* Documentación completa e integral */
#doc-arbol,
#integral-guide {
  margin-top: 32px;
}

#doc-arbol .doc-header,
#integral-guide .doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#doc-arbol .doc-header p,
#integral-guide .doc-header p {
  margin: 0;
  max-width: 780px;
}

#doc-arbol .docs-panel,
#integral-guide .docs-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 12px 14px 16px 14px;
  box-shadow: var(--shadow-soft);
  display: none;
}

#doc-arbol .docs-panel.open,
#integral-guide .docs-panel.open {
  display: block;
}

.doc-actions-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-doc-full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0d1a36;
  color: #e8f0ff;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.btn-doc-full:hover {
  transform: translateY(-1px);
  border-color: rgba(127,195,255,0.6);
  box-shadow: 0 14px 36px rgba(0,0,0,0.3);
}

.btn-doc-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  color: #cfd8f5;
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  font-size: 0.9rem;
  box-shadow: none;
  transition: border 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-doc-quiet:hover {
  border-color: rgba(127,195,255,0.4);
  color: #e8f0ff;
  background: rgba(255,255,255,0.08);
}

/* Mejor contraste en modo claro para el texto del link navegable */
body:not(.dark-mode) .btn-doc-quiet {
  color: #1b2438;
  border-color: rgba(0,0,0,0.08);
}

body:not(.dark-mode) .btn-doc-quiet:hover {
  color: #0f1629;
  border-color: rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.04);
}

#doc-arbol .doc-cards,
#integral-guide .doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

#doc-arbol .doc-card,
#integral-guide .doc-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.01);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

#doc-arbol .doc-card:hover,
#integral-guide .doc-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.15), 0 0 18px rgba(124, 244, 224, 0.28);
  background: rgba(37, 99, 235, 0.02);
}

#doc-arbol .doc-card summary,
#integral-guide .doc-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

#doc-arbol .doc-card summary::-webkit-details-marker,
#integral-guide .doc-card summary::-webkit-details-marker {
  display: none;
}

#doc-arbol .doc-card summary::before,
#integral-guide .doc-card summary::before {
  content: "▸";
  color: var(--color-accent-strong);
  transition: transform var(--transition);
  font-size: 0.92rem;
}

#doc-arbol .doc-card[open] > summary::before,
#integral-guide .doc-card[open] > summary::before {
  transform: rotate(90deg);
}

#doc-arbol .doc-card-head h3,
#integral-guide .doc-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

#doc-arbol .doc-card-head p {
  margin: 2px 0 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

#doc-arbol .doc-card-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 0.96rem;
  color: var(--color-text);
  line-height: 1.55;
}

#doc-arbol .doc-card-body h1,
#doc-arbol .doc-card-body h2,
#doc-arbol .doc-card-body h3,
#doc-arbol .doc-card-body h4,
#doc-arbol .doc-card-body h5,
#doc-arbol .doc-card-body h6 {
  margin: 8px 0 4px 0;
}

#doc-arbol .doc-card-body ul {
  margin: 6px 0 6px 18px;
  padding-left: 6px;
  display: grid;
  gap: 4px;
}

#doc-arbol .doc-card-body pre {
  background: rgba(15, 23, 42, 0.08);
  padding: 10px;
  border-radius: 10px;
  overflow: auto;
}

body.dark-mode #doc-arbol .doc-card {
  background: rgba(255,255,255,0.02);
}

body.dark-mode #doc-arbol .doc-card:hover {
  background: rgba(130, 180, 255, 0.05);
}

/* Modal documentación */
.doc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
}

.doc-modal.open { display: flex; }

.doc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.doc-modal-dialog {
  position: relative;
  width: min(1100px, 94vw);
  height: min(85vh, 900px);
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.doc-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.08);
  color: var(--color-text);
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  cursor: pointer;
}

.doc-modal-header {
  padding: 16px 48px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
}

.doc-modal-subtitle { margin: 4px 0 0 0; color: var(--color-muted); }

.doc-modal-actions button {
  margin-left: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
}

.doc-modal-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
  overflow: hidden;
}

.doc-modal-nav {
  border-right: 1px solid var(--color-border);
  padding: 12px 14px;
  background: rgba(0,0,0,0.02);
  overflow: auto;
}

.doc-modal-toc {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-item .toc-link {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.toc-item .toc-link:hover { background: var(--color-accent-soft); }
.toc-item .toc-link.level-1 { font-weight: 800; }
.toc-item .toc-link.level-2 { padding-left: 14px; font-weight: 700; }
.toc-item .toc-link.level-3 { padding-left: 22px; font-weight: 600; }

.toc-children { margin-left: 6px; border-left: 1px dashed var(--color-border); padding-left: 6px; }

.doc-modal-content {
  padding: 14px 18px;
  overflow: auto;
  scroll-behavior: smooth;
}

.doc-modal-content h1,
.doc-modal-content h2,
.doc-modal-content h3,
.doc-modal-content h4,
.doc-modal-content h5,
.doc-modal-content h6 { margin: 10px 0 6px 0; scroll-margin-top: 52px; }

/* TOC styling inside modal (clickable PASO buttons) */
.doc-modal .toc-link { width: 100%; text-align: left; padding: 6px 10px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--color-text); }
.doc-modal .toc-link.level-1 { font-weight: 800; cursor: pointer; }
.doc-modal .toc-link.level-2 { padding-left: 10px; font-weight: 700; cursor: pointer; }
.doc-modal .toc-link.level-3 { padding-left: 18px; font-weight: 600; cursor: default; }
.doc-modal .toc-link.level-4 { padding-left: 24px; cursor: default; }
.doc-modal .toc-link.level-1:hover,
.doc-modal .toc-link.level-2:hover { border-color: rgba(124, 244, 224, 0.6); box-shadow: 0 0 16px rgba(124, 244, 224, 0.55); }
.doc-modal .toc-disabled { color: var(--color-text-muted); border-color: transparent; background: transparent; box-shadow: none; cursor: default; }
.doc-modal .toc-cta {
  border: 1px solid rgba(79, 124, 244, 0.85);
  background: linear-gradient(135deg, rgba(79,124,244,0.35), rgba(124,244,224,0.24));
  box-shadow: 0 12px 26px rgba(79,124,244,0.22), 0 0 24px rgba(124,244,224,0.32);
  color: #e8f0ff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border 0.16s ease, background 0.16s ease;
}
.doc-modal .toc-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 244, 224, 0.75);
  box-shadow: 0 16px 32px rgba(79,124,244,0.3), 0 0 26px rgba(124,244,224,0.4);
  background: linear-gradient(135deg, rgba(79,124,244,0.45), rgba(124,244,224,0.32));
}
.doc-modal .toc-disabled:hover { border-color: transparent; box-shadow: none; }

/* Light mode text contrast for PASO links (modal TOC) */
body:not(.dark-mode) .doc-modal .toc-cta { color: #0f1a2f; }
body:not(.dark-mode) .doc-modal .toc-link.level-1,
body:not(.dark-mode) .doc-modal .toc-link.level-2 { color: #0f1a2f; }

.doc-modal-content ul { margin: 8px 0 8px 18px; }
.doc-modal-content pre {
  background: rgba(15,23,42,0.08);
  padding: 10px;
  border-radius: 10px;
  overflow: auto;
}

body.dark-mode .doc-modal-dialog { background: var(--color-bg-alt); }
body.dark-mode .doc-modal-nav { background: rgba(255,255,255,0.02); }
body.dark-mode .doc-modal-close { background: rgba(255,255,255,0.08); }

.modelo-cta::after {
  content: '→';
  font-size: 0.95rem;
}

.modelo-imp h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modelo-imp h3::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-amber);
}

/* Soporte */
#soporte {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.support-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.support-header h2 {
  margin: 0 0 8px 0;
}

.support-header p {
  margin: 0;
  max-width: 720px;
}

#btn-support-toggle {
  min-width: 200px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 2px solid rgba(79, 124, 244, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.35), 0 0 18px rgba(124, 244, 224, 0.45);
  text-shadow: 0 1px 8px rgba(0,0,0,0.18);
  border-radius: 999px;
}

#btn-support-toggle:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(79, 124, 244, 0.45), 0 0 22px rgba(124, 244, 224, 0.6);
}

#btn-support-toggle:active {
  transform: translateY(0) scale(0.995);
}

.support-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 10px 12px 18px 12px;
  box-shadow: var(--shadow-soft);
  display: none;
}

.support-panel.open {
  display: block;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.support-card {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-soft);
}

.support-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.support-card a {
  color: var(--color-text);
  font-weight: 600;
}

.support-card a:hover {
  color: var(--color-accent-strong);
}

/* Nota de ayuda (bloque informativo) */
.nota-ayuda {
  margin: 24px 0;
}

.ayuda-integrada {
  background: linear-gradient(135deg, rgba(78,205,196,0.15), rgba(85,98,112,0.15));
  border-left: 4px solid var(--color-primary);
  padding: 20px;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

/* Recursos */
#recursos {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 48px;
}

.recursos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.recursos-header h2 {
  margin: 0 0 8px 0;
}

.recursos-header p {
  margin: 0;
  max-width: 720px;
}

#btn-recursos-toggle {
  min-width: 200px;
  padding: 14px 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 2px solid rgba(79, 124, 244, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  box-shadow: 0 10px 24px rgba(79, 124, 244, 0.35), 0 0 18px rgba(124, 244, 224, 0.45);
  text-shadow: 0 1px 8px rgba(0,0,0,0.18);
  border-radius: 999px;
}

#btn-recursos-toggle:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 30px rgba(79, 124, 244, 0.45), 0 0 22px rgba(124, 244, 224, 0.6);
}

#btn-recursos-toggle:active {
  transform: translateY(0) scale(0.995);
}

.recursos-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  padding: 10px 12px 18px 12px;
  box-shadow: var(--shadow-soft);
  display: none;
}

.recursos-panel.open {
  display: block;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.resource-card {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
}

.resource-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.resource-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-card a {
  font-weight: 700;
}

.resource-meta {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.split-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  gap: 2px;
}

/* Flashcards & modal */
.resource-card.flashcards-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
}

.flashcards-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.flashcards-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 38px rgba(79, 124, 244, 0.18), 0 0 24px rgba(124, 244, 224, 0.28);
}

.glow-thumb {
  background: radial-gradient(circle at 30% 30%, rgba(124, 244, 224, 0.4), transparent 60%),
    linear-gradient(135deg, rgba(79, 124, 244, 0.4), rgba(124, 244, 224, 0.35));
  border: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.glow-thumb img {
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 10px rgba(124, 244, 224, 0.6));
}

.resource-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-accent);
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.resource-link:hover {
  text-decoration: underline;
  color: var(--color-accent-strong);
}

.small-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.85rem;
}

.flashcards-modal.hidden {
  display: none;
}

.flashcards-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 999;
}

.flashcards-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(124, 244, 224, 0.1), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(79, 124, 244, 0.12), transparent 38%),
    rgba(5, 10, 22, 0.78);
  backdrop-filter: blur(10px);
}

.flashcards-dialog {
  position: relative;
  width: min(1100px, 92vw);
  border-radius: 20px;
  padding: 26px 26px 22px;
  background: linear-gradient(135deg, rgba(19, 30, 54, 0.9), rgba(11, 18, 34, 0.95));
  border: 1px solid rgba(124, 244, 224, 0.25);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 0 40px rgba(124, 244, 224, 0.22);
  overflow: hidden;
}

.flashcards-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 240px;
  background: radial-gradient(circle at 30% 50%, rgba(124, 244, 224, 0.25), transparent 42%),
    radial-gradient(circle at 70% 40%, rgba(79, 124, 244, 0.22), transparent 45%);
  filter: blur(28px);
  opacity: 0.7;
  pointer-events: none;
}

.flashcards-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.flashcards-close:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,0.14);
}

.flashcards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  color: #e6f8ff;
}

.flashcards-header h3 {
  margin: 4px 0 6px 0;
  font-size: 1.65rem;
}

.flashcards-header .subhead {
  margin: 0;
  color: #bcd8ff;
}

.flashcards-header .kicker {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.82rem;
  margin: 0;
  color: #7cf4e0;
}

.flashcards-lang {
  display: inline-flex;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}

.lang-btn {
  border: none;
  background: transparent;
  color: #e6f8ff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.lang-btn.active {
  background: linear-gradient(135deg, #4f7cf4, #7cf4e0);
  color: #0b1220;
  box-shadow: 0 8px 18px rgba(79, 124, 244, 0.3);
}

.lang-btn:hover {
  transform: translateY(-1px);
}

.flashcards-stage {
  position: relative;
  margin: 22px 0 12px;
  padding: 18px;
  background: radial-gradient(circle at 20% 30%, rgba(124, 244, 224, 0.12), transparent 44%),
    radial-gradient(circle at 80% 60%, rgba(79, 124, 244, 0.12), transparent 46%),
    rgba(255,255,255,0.03);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.flashcards-bg {
  position: absolute;
  inset: -60% -10%;
  background: conic-gradient(from 120deg, rgba(124, 244, 224, 0.12), rgba(79, 124, 244, 0.18), rgba(124, 244, 224, 0.12));
  filter: blur(52px);
  opacity: 0.8;
  pointer-events: none;
}

.flashcard {
  position: relative;
  background: linear-gradient(135deg, rgba(17, 29, 49, 0.95), rgba(19, 31, 58, 0.92));
  border: 1px solid rgba(124, 244, 224, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 20px 30px rgba(0,0,0,0.35);
  border-radius: 16px;
  padding: 20px;
  color: #eaf7ff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  transform: perspective(1200px) rotateX(0deg);
  transition: transform 320ms ease, box-shadow 320ms ease;
}

.flashcard.animate {
  transform: perspective(1200px) rotateX(6deg) scale(1.01);
  box-shadow: 0 24px 48px rgba(0,0,0,0.45), 0 0 22px rgba(124, 244, 224, 0.26);
}

.flashcard-face {
  position: relative;
  padding: 8px 6px;
}

.flashcard-pill {
  display: inline-block;
  background: rgba(124, 244, 224, 0.14);
  color: #7cf4e0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  border: 1px solid rgba(124, 244, 224, 0.35);
}

.flashcard-question,
.flashcard-answer {
  margin: 10px 0 0;
  font-size: 1.08rem;
  line-height: 1.6;
}

.flashcard-divider {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(124, 244, 224, 0.35), transparent);
  grid-column: 1 / -1;
}

.flashcards-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 12px;
}

.nav-btn {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(124, 244, 224, 0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: rgba(124, 244, 224, 0.18);
}

.flashcard-progress {
  flex: 1;
  text-align: center;
  color: #d8e9ff;
  font-weight: 700;
}

.flashcards-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #bcd8ff;
  font-size: 0.95rem;
}

.flashcards-footer a {
  color: #7cf4e0;
  font-weight: 700;
}

.flashcards-footer a:hover {
  text-decoration: underline;
}

.flashcards-hint {
  color: #86a6d8;
}

.foot-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .flashcards-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .flashcards-stage {
    padding: 12px;
  }

  .nav-btn {
    width: 46px;
    height: 46px;
  }
}

/* Footer */
footer {
  margin: 32px 0 0;
  padding: 20px 0 32px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 1024px) {
  h1 {
    font-size: 2rem;
  }

  main {
    padding: calc(var(--header-height) + 16px) 18px 56px;
  }

  .header-inner {
    gap: 12px;
  }

  .main-nav {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 90px;
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 10px 16px;
  }

  .logo-area {
    width: 100%;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-start;
  }

  #hero {
    padding: 32px 22px 28px;
  }

  #por-rol {
    grid-template-columns: 1fr;
  }

  #implementacion {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  main {
    padding: calc(var(--header-height) + 12px) 14px 48px;
  }

  #hero h1 {
    font-size: 1.7rem;
  }

  .hero-chips {
    gap: 8px;
  }

  button {
    padding: 8px 12px;
  }
}

/* ======================= MODULOS COLAPSABLES ======================= */
.modulos-section {
  margin: 2rem 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg-alt);
}

.modulos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  border: none;
  list-style: none;
  font-size: 1.2rem;
  font-weight: 600;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.module-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.modulos-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
  transition: var(--transition);
  opacity: 0;
}

.modulos-header:hover::before {
  opacity: 1;
}

.modulos-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.modulos-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: inherit;
}

/* Light mode: texto oscuro en el header principal de módulos */
body:not(.dark-mode) .modulos-header {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

body:not(.dark-mode) .modulos-header h2,
body:not(.dark-mode) .modulos-header .toggle-text,
body:not(.dark-mode) .modulos-header .module-count,
body:not(.dark-mode) .modulos-header .toggle-icon {
  color: var(--color-text);
}

.toggle-text {
  display: none;
}

.toggle-icon {
  font-size: 1.2rem;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.modulos-section[open] .toggle-icon {
  transform: rotate(180deg);
}

.modulos-content {
  padding: 0 1rem 1rem 1rem;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive para header de módulos */
@media (max-width: 768px) {
  .modulos-header h2 {
    font-size: 1rem;
    display: none;
  }
  
  .toggle-text {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .modulos-header {
    padding: 1rem 1.5rem;
  }
  
  .module-count {
    display: none;
  }
  
  .header-right {
    gap: 0.5rem;
  }
}

/* ==================== MÓDULOS COLAPSABLES ==================== */
details.modulo {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: var(--transition);
}

details.modulo[open] {
  box-shadow: var(--shadow);
}

details.modulo summary.module-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  cursor: pointer;
  user-select: none;
  position: relative;
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
  list-style: none;
}

details.modulo summary.module-header::-webkit-details-marker {
  display: none;
}

details.modulo summary.module-header:hover {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-accent) 5%, var(--color-bg-alt) 100%);
}

details.modulo summary.module-header .module-media {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: calc(var(--radius) / 2);
  background: rgba(255, 255, 255, 0.1);
}

details.modulo summary.module-header .module-media img,
details.modulo summary.module-header .module-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

details.modulo summary.module-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

details.modulo summary.module-header .module-toggle {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--color-accent);
  transition: var(--transition);
}

details.modulo[open] summary.module-header .module-toggle {
  transform: rotate(180deg);
}

details.modulo .module-content {
  padding: 0 1.5rem 1.5rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for modules */
@media (max-width: 768px) {
  details.modulo summary.module-header {
    padding: 1rem;
    gap: 0.8rem;
  }
  
  details.modulo summary.module-header .module-media {
    width: 40px;
    height: 40px;
  }
  
  details.modulo summary.module-header h3 {
    font-size: 1.1rem;
  }
  
  details.modulo .module-content {
    padding: 0 1rem 1rem;
  }
}
