/* =============================================================
   Sistema de diseño — tema claro / oscuro con variables CSS
   ============================================================= */
:root {
  color-scheme: light;
  --bg: #F6F7FC;
  --surface: #FFFFFF;
  --surface-2: #F0F1FA;
  --surface-3: #E6E8F6;
  --border: #E2E5F3;
  --border-strong: #CBD0E8;
  --text: #131936;
  --text-2: #444C73;
  --muted: #62698F;
  --primary: #5B3FD4;
  --primary-text: #4B2FC0;
  --primary-soft: #ECE8FD;
  --btn-bg: #5B3FD4;
  --btn-bg-hover: #4A31B8;
  --accent: #F5B301;
  --accent-ink: #261B00;
  --success: #0B7F60;  --success-soft: #DCF4EA;
  --danger: #BE2840;   --danger-soft: #FCE5E9;
  --warning: #98590A;  --warning-soft: #FFF0D2;
  --info: #1A5FC4;     --info-soft: #E0ECFC;
  --ring: rgba(91, 63, 212, .28);
  --shadow-sm: 0 1px 2px rgba(19, 25, 54, .06), 0 1px 1px rgba(19, 25, 54, .04);
  --shadow: 0 10px 28px rgba(45, 32, 120, .09), 0 2px 6px rgba(19, 25, 54, .05);
  --shadow-lg: 0 28px 70px rgba(45, 32, 120, .18);
  --hero-bg: radial-gradient(900px 420px at 85% -10%, rgba(139, 124, 255, .28), transparent 60%),
             radial-gradient(700px 380px at -5% 10%, rgba(245, 179, 1, .14), transparent 60%), var(--bg);
  --series-1: #5B3FD4; /* validada con validate_palette.js (banda L, croma y contraste >= 3:1 sobre la tarjeta) */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 22px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090E1F;
  --surface: #111836;
  --surface-2: #182049;
  --surface-3: #212B5E;
  --border: #232D5C;
  --border-strong: #35417C;
  --text: #EDF0FF;
  --text-2: #BCC4E6;
  --muted: #8F99C6;
  --primary: #9C8FFF;
  --primary-text: #B7ADFF;
  --primary-soft: rgba(139, 124, 255, .16);
  --btn-bg: #6A58EE;
  --btn-bg-hover: #7B6AF5;
  --accent-ink: #261B00;
  --success: #3DD6A7;  --success-soft: rgba(61, 214, 167, .14);
  --danger: #FF7A8C;   --danger-soft: rgba(255, 122, 140, .14);
  --warning: #FFC15A;  --warning-soft: rgba(255, 193, 90, .14);
  --info: #6FA8FF;     --info-soft: rgba(111, 168, 255, .14);
  --ring: rgba(156, 143, 255, .38);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  --hero-bg: radial-gradient(900px 460px at 85% -10%, rgba(106, 88, 238, .38), transparent 60%),
             radial-gradient(700px 400px at -5% 15%, rgba(61, 214, 167, .10), transparent 60%), var(--bg);
  --series-1: #8B7CFF; /* paso oscuro validado: L 0.48-0.67 y contraste >= 3:1 sobre #111836 */
}

/* ---------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.18; letter-spacing: -.02em; font-weight: 800; color: var(--text); }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary); color: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--btn-bg); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 8px; }

.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.icon[data-fill] { fill: currentColor; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.2em; height: 2.2em; stroke-width: 1.6; }

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.container-sm { width: min(820px, 100% - 2rem); margin-inline: auto; }
.section { padding: clamp(2.75rem, 6vw, 5rem) 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: .5rem 0 0; color: var(--muted); max-width: 56ch; }
.eyebrow { display: inline-block; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--primary-text); margin-bottom: .6rem; }
.lead { font-size: 1.12rem; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; } .between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.grow { flex: 1; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-courses { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* -------------------------------------------------------- botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.25rem; border-radius: 12px; border: 1.5px solid transparent;
  font: 700 .95rem/1.2 var(--font); cursor: pointer; text-decoration: none !important;
  transition: background-color .18s, border-color .18s, transform .12s, box-shadow .18s, color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: #fff; box-shadow: 0 6px 16px -6px var(--ring); }
.btn-primary:hover { background: var(--btn-bg-hover); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: .45rem .8rem; font-size: .84rem; border-radius: 10px; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.02rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: 12px; background: transparent; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ----------------------------------------------------- formularios */
.field { margin-bottom: 1.1rem; }
.field > label, .label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: .4rem; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.field .error { font-size: .82rem; color: var(--danger); margin-top: .35rem; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; padding: .72rem .9rem; border-radius: 12px; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 500 .98rem var(--font); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); }
.input-group { position: relative; }
.input-group .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-group .input { padding-left: 2.6rem; }
.input-group .toggle-pass { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); }
.field > label.check { font-weight: 500; font-size: .92rem; margin-bottom: 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--btn-bg); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
input[type="file"].input { padding: .55rem .7rem; }
input[type="color"].input { padding: .25rem; height: 46px; }

/* ----------------------------------------------------- tarjetas */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 1.5rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-body { padding: 1.5rem; }
.card-hover { transition: transform .2s, box-shadow .2s, border-color .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }

.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid transparent; font-size: .93rem; margin-bottom: 1rem; }
.alert .icon { margin-top: .2rem; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert strong { color: inherit; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, #8B7CFF, #5B3FD4); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl { width: 110px; height: 110px; font-size: 2rem; }

.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--btn-bg), #8B7CFF); border-radius: 99px; transition: width .5s ease; }
.progress.done > span { background: var(--success); }

.stars { display: inline-flex; gap: 1px; color: var(--accent); }
.stars .icon { width: .95em; height: .95em; }
.stars .off { color: var(--border-strong); }
.rating { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .88rem; }

.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .icon { width: 3rem; height: 3rem; margin: 0 auto 1rem; color: var(--border-strong); stroke-width: 1.4; }
.empty h3 { color: var(--text); }

/* -------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 1.25rem; min-height: 68px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #8B7CFF, #5B3FD4); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px rgba(91, 63, 212, .7); }
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2; }
.brand b { color: var(--primary-text); font-weight: 800; }
.main-nav { display: flex; gap: .25rem; margin-left: .5rem; }
.main-nav a { padding: .5rem .85rem; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .94rem; text-decoration: none !important; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a.active { color: var(--primary-text); background: var(--primary-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.header-search { position: relative; }
.header-search .input { padding: .5rem .8rem .5rem 2.3rem; width: 210px; border-radius: 99px; font-size: .9rem; background: var(--surface); }
.header-search .icon { left: .8rem; }
.icon-btn { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--btn-bg); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.menu-btn { display: none; }
.nav-auth { display: none; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem .25rem .25rem; border-radius: 99px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-2); }
.user-menu .avatar { width: 36px; height: 36px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .5rem; z-index: 70; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .75rem; border-radius: 9px; color: var(--text-2); font: 600 .92rem var(--font); background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none !important; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--text); }
.dropdown .dd-head { padding: .6rem .75rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .4rem; }
.dropdown .dd-head b { display: block; color: var(--text); }
@media (max-width: 960px) {
  .menu-btn { display: inline-grid; }
  .header-search { display: none; }
  .main-nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--bg); padding: 1rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); margin: 0; transform: translateY(-120%); transition: transform .25s; z-index: 55; }
  .nav-open .main-nav { transform: none; }
  .main-nav a { padding: .8rem 1rem; font-size: 1rem; }
  .nav-auth { display: block; }
  .nav-auth-cta { background: var(--btn-bg); color: #fff !important; text-align: center; margin-top: .3rem; }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) { .hide-xs { display: none !important; } .header-row { gap: .5rem; } .header-actions { gap: .15rem; } }
@media (max-width: 440px) { .brand { font-size: 1.1rem; min-width: 0; } .brand span:last-child { max-width: 96px; overflow: hidden; text-overflow: ellipsis; } .icon-btn { width: 38px; } .user-menu .avatar { width: 32px; height: 32px; } }

/* ----------------------------------------------------------- hero */
.hero { background: var(--hero-bg); padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5.5rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero h1 .accent { background: linear-gradient(90deg, var(--primary), #C06BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { max-width: 52ch; margin: 1.2rem 0 1.6rem; }
.hero-search { display: flex; gap: .5rem; padding: .4rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 520px; }
.hero-search .input { border: 0; box-shadow: none !important; background: transparent; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.1rem; }
.hero-proof { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-proof .sep { width: 1px; height: 38px; background: var(--border-strong); }
.hero-proof b { font-size: 1.35rem; font-weight: 800; display: block; line-height: 1.1; }
.avatars { display: flex; }
.avatars .avatar { width: 38px; height: 38px; margin-left: -10px; border: 2px solid var(--bg); font-size: .78rem; }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .avatar:nth-child(2) { background: linear-gradient(135deg, #FFB347, #E8590C); }
.avatars .avatar:nth-child(3) { background: linear-gradient(135deg, #3DD6A7, #0C8F76); }
.avatars .avatar:nth-child(4) { background: linear-gradient(135deg, #6FA8FF, #2B7DE9); }

.hero-visual { position: relative; min-height: 440px; }
.mock-card { position: absolute; inset: 20px 30px 20px 40px; border-radius: 26px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }
.mock-video { flex: 1; position: relative; background: linear-gradient(135deg, #6A58EE, #2A1B86 70%); display: grid; place-items: center; overflow: hidden; }
.mock-video::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .25), transparent 40%), radial-gradient(circle at 85% 90%, rgba(245, 179, 1, .35), transparent 35%); }
.mock-video .play { position: relative; width: 74px; height: 74px; border-radius: 50%; background: #fff; color: #5B3FD4; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.mock-video .play .icon { width: 28px; height: 28px; fill: currentColor; stroke: none; margin-left: 3px; }
.mock-meta { padding: 1.1rem 1.3rem 1.3rem; }
.mock-meta b { display: block; font-size: 1rem; }
.mock-meta .progress { margin: .7rem 0 .4rem; }
.float-chip { position: absolute; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: floaty 6s ease-in-out infinite; }
.float-chip .ci { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.float-chip small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.2; }
.float-chip b { font-size: 1.1rem; line-height: 1.2; }
.fc-1 { top: 0; left: 0; } .fc-2 { top: 60px; right: 0; animation-delay: -2s; } .fc-3 { top: 200px; left: -8px; animation-delay: -4s; } .fc-4 { bottom: 0; right: 14px; animation-delay: -1s; }
.fc-2 .ci { background: var(--warning-soft); color: var(--warning); } .fc-3 .ci { background: var(--success-soft); color: var(--success); } .fc-4 .ci { background: var(--info-soft); color: var(--info); }
@keyframes floaty { 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .float-chip { animation: none; } * { scroll-behavior: auto !important; } }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { min-height: 380px; max-width: 520px; margin: 1rem auto 0; width: 100%; } }

/* ------------------------------------------------ bloques de home */
.trust { padding: 1.6rem 0; border-block: 1px solid var(--border); background: var(--surface); }
.trust-row { display: flex; align-items: center; justify-content: center; gap: 1rem 2.5rem; flex-wrap: wrap; color: var(--muted); }
.trust-row span.label { font-size: .85rem; font-weight: 600; }
.trust-row .partner { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; opacity: .7; }

.cat-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; text-decoration: none !important; color: var(--text); }
.cat-card .ci { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 16%, transparent); color: var(--cc); margin-bottom: .4rem; }
[data-theme="dark"] .cat-card .ci { color: color-mix(in srgb, var(--cc) 55%, #fff); }
.cat-card .ci .icon { width: 24px; height: 24px; }
.cat-card b { font-size: 1.02rem; }
.cat-card span { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.cat-card .count { font-size: .8rem; font-weight: 700; color: var(--primary-text); margin-top: auto; padding-top: .4rem; }

.feature { padding: 1.5rem; }
.feature .fi { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1rem; background: var(--primary-soft); color: var(--primary-text); }
.feature .fi .icon { width: 24px; height: 24px; }
.feature:nth-child(2) .fi { background: var(--success-soft); color: var(--success); }
.feature:nth-child(3) .fi { background: var(--warning-soft); color: var(--warning); }
.feature:nth-child(4) .fi { background: var(--info-soft); color: var(--info); }
.feature:nth-child(5) .fi { background: var(--danger-soft); color: var(--danger); }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; }

.stats-band { background: linear-gradient(120deg, #1B1457, #2D1F8F 60%, #4A31B8); color: #fff; border-radius: var(--radius-lg); padding: 2.2rem 2rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; box-shadow: var(--shadow); }
.stats-band .st { display: flex; align-items: center; gap: 1rem; }
.stats-band .si { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.stats-band b { display: block; font-size: 1.7rem; line-height: 1.1; font-weight: 800; }
.stats-band small { color: rgba(255, 255, 255, .75); font-size: .85rem; }
@media (max-width: 900px) { .stats-band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-band { grid-template-columns: 1fr; } }

.testimonial { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.testimonial blockquote { margin: 0; color: var(--text-2); position: relative; }
.testimonial .who { display: flex; align-items: center; gap: .75rem; margin-top: auto; }
.testimonial .who b { display: block; line-height: 1.2; }

.instructor-card { padding: 1.5rem; text-align: center; text-decoration: none !important; color: var(--text); display: block; }
.instructor-card .avatar { margin: 0 auto 1rem; }
.instructor-card b { display: block; font-size: 1.05rem; }
.instructor-card span { color: var(--muted); font-size: .88rem; }

.cta-box { background: linear-gradient(120deg, #4A31B8, #6A58EE 55%, #8B5CF6); border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.2rem); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; box-shadow: var(--shadow); }
.cta-box h2 { color: #fff; margin: 0 0 .4rem; }
.cta-box p { margin: 0; color: rgba(255, 255, 255, .85); }
.newsletter { display: flex; gap: .5rem; flex: 1; min-width: min(100%, 320px); max-width: 480px; }
.newsletter .input { background: rgba(255, 255, 255, .96); color: #131936; border-color: transparent; }

/* --------------------------------------------------- course card */
.course-card { display: flex; flex-direction: column; overflow: hidden; position: relative; height: 100%; }
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--c1, #6A58EE), var(--c2, #2A1B86)); color: #fff; }
.cover::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .28), transparent 45%), radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.5px) 0 0 / 14px 14px; }
.cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .cover-icon { position: absolute; right: -8%; bottom: -16%; width: 62%; height: auto; opacity: .2; stroke-width: 1.2; }
.cover .cover-title { position: absolute; left: 1rem; right: 38%; bottom: .9rem; font-weight: 800; font-size: 1.05rem; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.cover .tag { position: absolute; top: .75rem; left: .75rem; }
.cover .tag .badge { background: rgba(10, 14, 32, .62); color: #fff; backdrop-filter: blur(6px); }
.cover .play-hint { position: absolute; inset: 0; display: grid; place-items: center; }
.cover .play-hint span { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .95); color: #4A31B8; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); transition: transform .2s; }
.cover .play-hint .icon { fill: currentColor; stroke: none; margin-left: 2px; width: 22px; height: 22px; }
.cover-link:hover .play-hint span { transform: scale(1.08); }
.fav-form { position: absolute; top: .6rem; right: .6rem; z-index: 3; }
.fav-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 14, 32, .55); color: #fff; border: 0; cursor: pointer; backdrop-filter: blur(6px); transition: transform .15s, background .15s; }
.fav-btn:hover { transform: scale(1.1); background: rgba(10, 14, 32, .8); }
.fav-btn.is-active { background: #fff; color: #E03156; }
.fav-btn.is-active .icon { fill: currentColor; }
.fav-btn.fav-text { width: auto; height: auto; display: inline-flex; gap: .5rem; align-items: center; padding: .5rem .8rem; border-radius: 10px; background: none; color: var(--text-2); font: 700 .88rem var(--font); backdrop-filter: none; }
.fav-btn.fav-text:hover { background: var(--surface-2); transform: none; }
.fav-btn.fav-text.is-active { background: none; color: #E03156; }
.course-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.course-cat { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-text); }
.course-title { font-size: 1.04rem; font-weight: 800; line-height: 1.28; margin: 0; letter-spacing: -.01em; }
.course-title a { color: var(--text); text-decoration: none !important; }
.course-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fav-form { z-index: 3; }
.course-by { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.course-meta { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.course-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.course-foot { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; }
.price { font-weight: 800; font-size: 1.25rem; line-height: 1.1; color: var(--text); }
.price small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin-top: .15rem; }
.price s { color: var(--muted); font-weight: 600; font-size: .85rem; margin-left: .35rem; }
.price.free { color: var(--success); }

/* ------------------------------------------------------- catálogo */
.page-head { padding: 2.5rem 0 1.5rem; background: var(--hero-bg); border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .4rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.catalog { display: grid; grid-template-columns: 270px 1fr; gap: 2rem; align-items: start; padding: 2rem 0 4rem; }
.filters { position: sticky; top: 84px; padding: 1.25rem; }
.filters h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.2rem 0 .6rem; }
.filters h3:first-child { margin-top: 0; }
.filter-list a { display: flex; justify-content: space-between; align-items: center; padding: .42rem .6rem; border-radius: 9px; color: var(--text-2); font-size: .92rem; text-decoration: none !important; }
.filter-list a:hover { background: var(--surface-2); }
.filter-list a.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.filter-list a small { color: var(--muted); }
.filter-list .sub a { margin-left: 1rem; font-size: .86rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 99px; background: var(--primary-soft); color: var(--primary-text); font-size: .8rem; font-weight: 700; text-decoration: none !important; }
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 .7rem; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .9rem; text-decoration: none !important; }
.pagination a:hover { border-color: var(--primary); color: var(--primary-text); }
.pagination .current { background: var(--btn-bg); border-color: var(--btn-bg); color: #fff; }
.pagination .gap { border: 0; background: none; }
@media (max-width: 900px) { .catalog { grid-template-columns: 1fr; } .filters { position: static; } }

/* ------------------------------------------------- ficha de curso */
.course-hero { background: linear-gradient(135deg, #17104A, #2D1F8F 65%, #4A31B8); color: #fff; padding: 2.5rem 0 3rem; }
[data-theme="dark"] .course-hero { background: linear-gradient(135deg, #0C0F2E, #1A1660 65%, #2D1F8F); }
.course-hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.course-hero .lead { color: rgba(255, 255, 255, .85); max-width: 62ch; }
.course-hero a { color: #CFC8FF; }
.breadcrumb { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .85rem; margin-bottom: 1rem; color: rgba(255, 255, 255, .7); }
.breadcrumb a { color: rgba(255, 255, 255, .85); }
.hero-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 1.2rem; font-size: .92rem; color: rgba(255, 255, 255, .9); }
.hero-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.course-layout > * { min-width: 0; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 2.5rem; align-items: start; padding: 2.5rem 0 4rem; }
.buy-card { position: sticky; top: 84px; margin-top: -9rem; overflow: hidden; box-shadow: var(--shadow-lg); }
.buy-card .cover { aspect-ratio: 16 / 9; }
.buy-body { padding: 1.4rem; }
.buy-price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.buy-price small { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: .35rem; }
.buy-price s { font-size: 1.1rem; font-weight: 600; color: var(--muted); margin-left: .4rem; }
.facts { margin: 1.1rem 0; display: grid; gap: .65rem; }
.facts li { display: flex; align-items: center; gap: .65rem; font-size: .92rem; color: var(--text-2); }
.facts .icon { color: var(--primary-text); }
.tabs-title { font-size: 1.35rem; margin: 2rem 0 1rem; }
.learn-box { padding: 1.4rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem 1.5rem; }
.learn-box li { display: flex; gap: .6rem; font-size: .93rem; color: var(--text-2); }
.learn-box .icon { color: var(--success); margin-top: .25rem; }
.prose { color: var(--text-2); line-height: 1.75; }
.prose p { margin-bottom: 1em; }
.accordion details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .6rem; overflow: hidden; }
.accordion summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 700; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .chev { transition: transform .2s; color: var(--muted); }
.accordion details[open] summary .chev { transform: rotate(180deg); }
.accordion details[open] summary { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.accordion .mod-desc { padding: .9rem 1.2rem 0; color: var(--muted); font-size: .9rem; margin: 0; }
.lesson-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.2rem; font-size: .92rem; color: var(--text-2); border-top: 1px solid var(--border); }
.lesson-row:first-child { border-top: 0; }
.lesson-row .icon { color: var(--muted); }
.lesson-row .dur { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.lesson-row a { color: var(--primary-text); font-weight: 700; }
.instructor-box { display: flex; gap: 1.25rem; padding: 1.4rem; align-items: flex-start; }
.review { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.review:first-of-type { border-top: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #cbd0f0; padding: 1rem; background: linear-gradient(135deg, #17104A, #2D1F8F); }
@media (max-width: 960px) { .course-layout { grid-template-columns: minmax(0, 1fr); } .buy-card { position: static; margin-top: 0; } .learn-box { grid-template-columns: 1fr; } }
.mobile-buy { display: none; }
@media (max-width: 960px) {
  .mobile-buy { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: .75rem 1rem; gap: 1rem; align-items: center; justify-content: space-between; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); }
  body.has-mobile-buy { padding-bottom: 76px; }
}

/* ----------------------------------------------------------- auth */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: linear-gradient(150deg, #17104A, #2D1F8F 55%, #6A58EE); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -180px; background: radial-gradient(circle, rgba(245, 179, 1, .35), transparent 65%); }
.auth-aside .brand { color: #fff; } .auth-aside .brand b { color: #CFC8FF; }
.auth-aside h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.5rem); max-width: 16ch; }
.auth-aside ul { display: grid; gap: .8rem; margin-top: 1.5rem; position: relative; }
.auth-aside li { display: flex; gap: .7rem; color: rgba(255, 255, 255, .88); }
.auth-aside li .icon { color: var(--accent); margin-top: .25rem; }
.auth-main { display: flex; flex-direction: column; padding: 1.5rem; }
.auth-main .top { display: flex; justify-content: space-between; align-items: center; }
.auth-card { width: min(440px, 100%); margin: auto; padding: 2rem 0; }
.auth-card h1 { font-size: 1.9rem; margin-bottom: .4rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1.4rem; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ------------------------------------------------ carrito / pagos */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; padding: 2rem 0 4rem; }
.cart-item { display: grid; grid-template-columns: 150px 1fr auto; gap: 1.1rem; padding: 1.1rem; align-items: center; }
.cart-item .cover { border-radius: 12px; }
.cart-item h3 { font-size: 1.02rem; margin-bottom: .2rem; }
.summary { padding: 1.4rem; position: sticky; top: 84px; }
.summary .row { display: flex; justify-content: space-between; padding: .45rem 0; color: var(--text-2); }
.summary .row.total { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: 1rem; font-weight: 800; font-size: 1.25rem; color: var(--text); }
.summary .row.discount { color: var(--success); font-weight: 600; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.25rem; }
.pay-method { position: relative; }
.pay-method input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pay-method span { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .9rem .4rem; border: 1.5px solid var(--border-strong); border-radius: 12px; font-weight: 700; font-size: .88rem; background: var(--surface); transition: all .15s; }
.pay-method input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); box-shadow: 0 0 0 3px var(--ring); }
.pay-method input:focus-visible + span { outline: 3px solid var(--ring); }
.sandbox-note { display: flex; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-size: .85rem; margin-bottom: 1.1rem; }
@media (max-width: 960px) { .cart-layout { grid-template-columns: 1fr; } .summary { position: static; } }
@media (max-width: 560px) { .cart-item { grid-template-columns: 1fr; } .cart-item .cover { max-width: 260px; } }

/* ------------------------------------- cuenta del estudiante */
.account { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; align-items: start; padding: 2rem 0 4rem; }
.account > * { min-width: 0; }
.side-nav { position: sticky; top: 84px; padding: .7rem; }
.side-nav .who { display: flex; gap: .7rem; align-items: center; padding: .7rem .7rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.side-nav .who b { display: block; line-height: 1.2; font-size: .95rem; }
.side-nav .who small { color: var(--muted); }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none !important; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary-text); }
.side-nav a .count { margin-left: auto; background: var(--btn-bg); color: #fff; border-radius: 99px; font-size: .7rem; padding: .05rem .5rem; font-weight: 800; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-title h1 { font-size: 1.8rem; margin: 0; letter-spacing: -.025em; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-tile { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: .9rem; }
.stat-tile .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.stat-tile b { display: block; font-size: 1.55rem; line-height: 1.1; font-weight: 800; }
.stat-tile small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat-tile.t2 .si { background: var(--success-soft); color: var(--success); } .stat-tile.t3 .si { background: var(--warning-soft); color: var(--warning); } .stat-tile.t4 .si { background: var(--info-soft); color: var(--info); }
.continue { display: grid; grid-template-columns: 240px 1fr; overflow: hidden; margin-bottom: 1.5rem; background: linear-gradient(120deg, var(--surface), var(--primary-soft)); }
.continue .cover { aspect-ratio: auto; min-height: 170px; }
.continue .cbody { padding: 1.4rem; display: flex; flex-direction: column; gap: .5rem; justify-content: center; }
.enroll-card .course-body { gap: .6rem; }
.mini-list > * + * { border-top: 1px solid var(--border); }
.mini-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; }
.mini-row .ci { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex: none; }
.notif { display: flex; gap: .9rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--primary-soft); }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--btn-bg); margin-top: .5rem; flex: none; }
.notif.read .dot { background: transparent; }
@media (max-width: 960px) {
  .account { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: .25rem; padding: .5rem; }
  .side-nav .who { display: none; } .side-nav a { white-space: nowrap; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .continue { grid-template-columns: 1fr; }
}

/* ----------------------------------------------- reproductor */
.learn-top { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.learn-top .row { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.learn-top .ttl { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-top .prog { width: 190px; flex: none; }
.learn-top .prog small { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; margin-bottom: .2rem; }
.player { display: grid; grid-template-columns: 1fr 380px; min-height: calc(100vh - 61px); align-items: start; }
.player-main { padding: 1.5rem; min-width: 0; }
.player-side { border-left: 1px solid var(--border); background: var(--surface); position: sticky; top: 61px; max-height: calc(100vh - 61px); overflow: auto; }
.player-side h2 { font-size: 1rem; padding: 1.1rem 1.2rem; margin: 0; border-bottom: 1px solid var(--border); }
.side-mod > summary { list-style: none; cursor: pointer; padding: .85rem 1.2rem; background: var(--surface-2); font-weight: 700; font-size: .9rem; display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--border); }
.side-mod > summary::-webkit-details-marker { display: none; }
.side-mod summary small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.lesson-link { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem 1.2rem; color: var(--text-2); font-size: .9rem; text-decoration: none !important; border-bottom: 1px solid var(--border); }
.lesson-link:hover { background: var(--surface-2); }
.lesson-link.current { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--btn-bg); }
.lesson-link .st { margin-top: .15rem; color: var(--border-strong); }
.lesson-link.done .st { color: var(--success); }
.lesson-link small { display: block; color: var(--muted); font-weight: 500; }
.lesson-actions { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: 1.25rem 0; }
.tab-list { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: 1.5rem 0 1.25rem; overflow-x: auto; }
.tab-list button { background: none; border: 0; padding: .8rem 1.1rem; font: 700 .93rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-list button[aria-selected="true"] { color: var(--primary-text); border-color: var(--btn-bg); }
.comment { display: flex; gap: .8rem; padding: 1rem 0; border-top: 1px solid var(--border); }
.comment .body { flex: 1; min-width: 0; }
.comment .replies { margin-top: .5rem; padding-left: 1rem; border-left: 2px solid var(--border); }
.comment p { margin: .2rem 0 .4rem; white-space: pre-wrap; word-wrap: break-word; }
@media (max-width: 1000px) { .player { grid-template-columns: 1fr; } .player-side { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--border); } .learn-top .prog { display: none; } }

/* ---------------------------------------------------- soporte */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.wa-preview { width: 100%; min-height: 130px; background: var(--surface-2); border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: .9rem; font: 500 .9rem/1.5 var(--font); color: var(--text-2); resize: vertical; }
.contact-line { display: flex; gap: .8rem; align-items: center; padding: .8rem 0; }
.contact-line .ci { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; }
.faq-cat { margin: 1.8rem 0 .7rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
@media (max-width: 900px) { .support-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------ legal */
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1em; }

/* ------------------------------------------------------ footer */
.site-footer { background: #0A0E24; color: #B9C0E3; padding: 3.5rem 0 1.5rem; margin-top: 2rem; }
.site-footer a { color: #B9C0E3; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; } .site-footer .brand b { color: #A99EFF; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; letter-spacing: 0; }
.footer-grid li { margin-bottom: .55rem; font-size: .92rem; }
.footer-grid li a { text-decoration: none; display: inline-flex; gap: .5rem; align-items: center; }
.socials { display: flex; gap: .5rem; margin-top: 1.1rem; }
.socials a { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); transition: background .15s; }
.socials a:hover { background: var(--btn-bg); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }
.footer-bottom button { background: none; border: 0; color: #B9C0E3; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 54px; height: 54px; border-radius: 50%; background: #1FA855; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0, 0, 0, .3); transition: transform .15s; text-decoration: none !important; }
.wa-float:hover { transform: scale(1.08); color: #fff; }
.wa-float .icon { width: 28px; height: 28px; }
body.has-mobile-buy .wa-float { bottom: 90px; }

/* ----------------------------------------------- cookies / toasts */
.cookie-bar { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 90; max-width: 760px; margin-inline: auto; padding: 1.1rem 1.3rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg); }
.cookie-bar p { margin: 0; flex: 1 1 300px; font-size: .88rem; color: var(--text-2); }
dialog.modal { border: 1px solid var(--border-strong); border-radius: 20px; padding: 0; width: min(520px, 94vw); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(5, 8, 24, .6); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 1.3rem 1.5rem; }
.modal-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.pref { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.pref:last-child { border: 0; }
.pref p { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--btn-bg); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled { cursor: not-allowed; } .switch input:disabled + i { opacity: .6; }
.switch input:focus-visible + i { outline: 3px solid var(--ring); outline-offset: 2px; }
.toasts { position: fixed; top: 78px; right: 1rem; z-index: 100; display: grid; gap: .6rem; width: min(380px, calc(100% - 2rem)); }
.toast { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .3s ease; }
.toast.success { border-left: 4px solid var(--success); } .toast.error { border-left: 4px solid var(--danger); } .toast.info { border-left: 4px solid var(--info); } .toast.warning { border-left: 4px solid var(--warning); }
.toast .icon { margin-top: .2rem; }
.toast.success .icon { color: var(--success); } .toast.error .icon { color: var(--danger); } .toast.info .icon { color: var(--info); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ----------------------------------------------------- certificado */
.cert-wrap { max-width: 960px; margin: 2rem auto; }
.cert { aspect-ratio: 1.414 / 1; background: #FFFDF7; color: #1B1A33; border-radius: 6px; padding: 14px; box-shadow: var(--shadow-lg); position: relative; }
.cert-inner { height: 100%; border: 3px double #B8902E; padding: clamp(1rem, 3vw, 2.4rem); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .4rem; position: relative; }
.cert .brand { color: #1B1A33; font-size: 1.4rem; } .cert .brand b { color: #5B3FD4; }
.cert h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: clamp(1.4rem, 4.2vw, 2.7rem); letter-spacing: .02em; color: #3A2C8F; margin: .6rem 0 0; text-transform: uppercase; }
.cert .name { font-family: Georgia, serif; font-size: clamp(1.4rem, 4vw, 2.6rem); font-style: italic; border-bottom: 1px solid #B8902E; padding: 0 2rem .2rem; margin: .5rem 0; }
.cert .course { font-weight: 800; font-size: clamp(1rem, 2.4vw, 1.5rem); color: #3A2C8F; }
.cert .meta { display: flex; gap: 2rem; align-items: flex-end; justify-content: space-between; width: 100%; margin-top: 1rem; font-size: .8rem; color: #55557A; text-align: left; }
.cert .qr { width: 88px; height: 88px; background: #fff; padding: 4px; border: 1px solid #ddd; }
.cert .qr img, .cert .qr canvas { width: 100% !important; height: 100% !important; }
.verify-ok { display: flex; gap: 1rem; align-items: center; padding: 1.2rem 1.4rem; }
.verify-ok .ci { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); flex: none; }
@media (max-width: 640px) { .cert .meta { flex-direction: column; align-items: center; text-align: center; gap: .5rem; } .cert .qr { width: 64px; height: 64px; } }
@media print {
  .site-header, .site-footer, .no-print, .cookie-bar, .wa-float, .toasts, .page-head { display: none !important; }
  body { background: #fff !important; }
  .cert-wrap { margin: 0; max-width: none; } .cert { box-shadow: none; }
  @page { size: A4 landscape; margin: 8mm; }
}

/* ------------------------------------------------------ admin */
.admin-shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--border); padding: 1.1rem .9rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .15rem; }
.admin-side .brand { padding: .3rem .5rem 1rem; }
.admin-side .grp { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 1rem .7rem .4rem; }
.admin-side a { display: flex; align-items: center; gap: .7rem; padding: .56rem .75rem; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .91rem; text-decoration: none !important; }
.admin-side a:hover { background: var(--surface-2); color: var(--text); }
.admin-side a.active { background: var(--primary-soft); color: var(--primary-text); }
.admin-side a .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 99px; font-size: .68rem; padding: 0 .45rem; font-weight: 800; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.75rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.admin-content { padding: 1.75rem; flex: 1; }
.admin-top .menu-btn { display: none; }
.nav-auth { display: none; }
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: fixed; z-index: 80; width: 270px; transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .nav-open .admin-side { transform: none; }
  .admin-top .menu-btn { display: inline-grid; } .admin-content { padding: 1rem; } .admin-top { padding: .7rem 1rem; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { padding: 1.1rem 1.2rem; }
.kpi small { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: .15rem 0; }
.kpi .delta { font-size: .8rem; font-weight: 700; }
.kpi .delta.up { color: var(--success); } .kpi .delta.down { color: var(--danger); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: .75rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .actions { display: flex; gap: .35rem; justify-content: flex-end; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.cell-title .thumb { width: 64px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; flex: none; }
.cell-title b { display: block; line-height: 1.25; }
.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; align-items: center; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 150px; padding: .55rem .8rem; font-size: .9rem; }
.module-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 1rem; }
.module-box > .mh { display: flex; gap: .75rem; align-items: center; padding: .9rem 1.1rem; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.module-box .mh form { display: flex; flex-wrap: wrap; gap: .5rem; flex: 1; min-width: min(240px, 100%); }
.module-box .mh form .input { flex: 1 1 140px; min-width: 0; }
.module-box .lesson-admin { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .65rem 1.1rem; border-top: 1px solid var(--border); font-size: .9rem; }
.chart-card { padding: 1.25rem 1.4rem; }
.chart-card h3 { font-size: .98rem; margin-bottom: .15rem; }
.chart-card .sub { color: var(--muted); font-size: .82rem; margin: 0 0 1rem; }
.chart { position: relative; }
.chart-scroll { overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 520px; height: auto; overflow: visible; outline-offset: 4px; }
.chart text { fill: var(--muted); font: 600 10px var(--font); }
.chart text.end-label { fill: var(--text); font-weight: 700; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-line { stroke: var(--border-strong); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); fill-opacity: .1; stroke: none; }
.chart .end-dot, .chart .hdot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .xhair { stroke: var(--border-strong); stroke-width: 1; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 260px; padding: .6rem .8rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: .8rem; line-height: 1.35; }
.chart-tip .t-title { color: var(--text-2); font-weight: 600; margin-bottom: .25rem; }
.chart-tip .t-row { display: flex; align-items: center; gap: .5rem; }
.chart-tip .t-key { width: 12px; height: 0; border-top: 2px solid var(--series-1); border-radius: 2px; flex: none; }
.chart-tip .t-val { font-weight: 800; font-size: .95rem; color: var(--text); }
.chart-tip .t-series { color: var(--text-2); }
.chart-tip .t-note { color: var(--muted); margin-top: .2rem; }
.hbars { display: grid; gap: .15rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 36%) 1fr; gap: .8rem; align-items: center; padding: .3rem .4rem; border-radius: 8px; font-size: .86rem; }
.hbar:hover, .hbar:focus-visible { background: var(--surface-2); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .bar-area { display: flex; align-items: center; gap: .5rem; border-left: 1px solid var(--border-strong); min-height: 22px; }
.hbar .bar { flex: none; height: 16px; background: var(--series-1); border-radius: 0 4px 4px 0; transition: filter .15s; }
.hbar:hover .bar, .hbar:focus-visible .bar { filter: brightness(1.15); }
.hbar b { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.table-view { margin-top: .8rem; font-size: .85rem; }
.table-view summary { cursor: pointer; color: var(--primary-text); font-weight: 700; padding: .2rem 0; }
.table-view .table-wrap { margin-top: .5rem; border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg a, .seg button { padding: .38rem .85rem; border-radius: 9px; font: 700 .84rem var(--font); color: var(--text-2); text-decoration: none !important; border: 0; background: none; cursor: pointer; }
.seg a:hover { background: var(--surface); color: var(--text); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-sm); }
.delta { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 700; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); } .delta.flat { color: var(--muted); }
.delta .icon { width: 1.1em; height: 1.1em; }
.kpi-delta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .15rem; }
.admin-top strong { display: none; }
@media (max-width: 960px) { .admin-top strong { display: block; } }

/* -------------------------------------------------- instalador */
.install-shell { min-height: 100vh; background: var(--hero-bg); padding: 2rem 1rem 4rem; }
.install-card { width: min(760px, 100%); margin: 1.5rem auto 0; }
.install-top { width: min(760px, 100%); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.step { display: flex; gap: 1rem; padding: 1.5rem 1.6rem; border-bottom: 1px solid var(--border); }
.step:last-of-type { border-bottom: 0; }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--btn-bg); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.step-body { flex: 1; min-width: 0; }
.step-body h2 { font-size: 1.15rem; margin-bottom: .2rem; }
.req { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; font-size: .92rem; border-bottom: 1px dashed var(--border); }
.req:last-child { border: 0; }
.req .icon { flex: none; } .req.ok .icon { color: var(--success); } .req.bad .icon { color: var(--danger); } .req.warn .icon { color: var(--warning); }
.req small { color: var(--muted); margin-left: auto; text-align: right; }
