/* =====================================================================
   ACHO Academia — sistema visual
   Referencias: panel de aprendizaje (barra lateral + panel de perfil, violeta,
   hero negro con destellos) y bloque de precios (contenedor gris, botones
   píldora negros con halo, degradado iridiscente).
   Tipografía: Bricolage Grotesque (titulares) + Inter (interfaz).
   ===================================================================== */

:root {
  --canvas: #f3f2f7;
  --surface: #ffffff;
  --sunken: #f6f5fa;
  --ink: #141218;
  --ink-2: #3a3744;
  --muted: #6e6a7c;
  --line: #ecebf2;
  --line-2: #e2e0ea;
  --violet: #6c3bff;
  --violet-2: #8b66ff;
  --violet-3: #c9b8ff;
  --violet-soft: #efe9ff;
  --violet-ink: #4b1fe0;
  --black: #000;
  --green: #12a150;
  --green-soft: #e7f8ee;
  --red: #e5383b;
  --red-soft: #fdecec;
  --amber-soft: #fff4d6;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Inter", ui-sans-serif, system-ui, sans-serif;
  --lift: 0 1px 2px rgba(20, 18, 24, .04), 0 6px 20px -6px rgba(46, 26, 120, .10);
  --iridescent:
    radial-gradient(60% 120% at 12% 30%, #fff1a8 0%, rgba(255, 241, 168, 0) 60%),
    radial-gradient(50% 120% at 45% 80%, #ffc3e6 0%, rgba(255, 195, 230, 0) 60%),
    radial-gradient(55% 130% at 80% 20%, #c7d5ff 0%, rgba(199, 213, 255, 0) 60%),
    radial-gradient(40% 100% at 95% 90%, #cdf3ff 0%, rgba(205, 243, 255, 0) 60%),
    linear-gradient(90deg, #fdf7e8, #f9e9f6 50%, #e9eeff);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.025em; line-height: 1.12; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- utilidades ---------- */
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.semi { font-weight: 600; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mt-lg { margin-top: 28px; } .mt-xl { margin-top: 48px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 32px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.prose { overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.prose a, a.link { color: var(--violet); font-weight: 600; }
.prose a { word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
@media (min-width: 640px) { .card-pad { padding: 24px; } }
.lift { box-shadow: var(--lift); border-color: transparent; }
a.card, a.lift { transition: box-shadow .18s, transform .18s; display: block; }
a.card:hover, a.lift:hover { box-shadow: 0 2px 4px rgba(20,18,24,.05), 0 14px 32px -10px rgba(46,26,120,.22); transform: translateY(-2px); }
.panel-grey { background: #efeef3; border-radius: var(--r-xl); padding: 8px; }
.divided > * + * { border-top: 1px solid var(--line); }
.section-title { font-size: 20px; }
.page-title { font-size: clamp(26px, 3vw, 32px); font-weight: 800; }
.empty { padding: 44px 20px; text-align: center; }
.empty .ico { font-size: 28px; margin-bottom: 8px; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: filter .15s, background .15s, box-shadow .15s; white-space: nowrap; line-height: 1.2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-dark { color: #fff; background: linear-gradient(180deg, #2a2733, #000 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 4px rgba(108,59,255,.10), 0 10px 24px -10px rgba(108,59,255,.75); }
.btn-dark:hover { filter: brightness(1.25); }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 8px 20px -10px rgba(108,59,255,.9); }
.btn-primary:hover { background: var(--violet-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--sunken); }
.btn-soft { background: var(--violet-soft); color: var(--violet-ink); }
.btn-soft:hover { background: #e4dbff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #f1f0f5; }
.btn-danger { background: var(--surface); border-color: #f7c9ca; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn .dot { width: 22px; height: 22px; border-radius: 999px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 11px; margin-right: -8px; }
.btn-white .dot { background: #000; }
.btn-text { background: none; border: 0; padding: 5px 9px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-text:hover { background: var(--sunken); color: var(--ink); }
.btn-text.on { color: var(--violet); }
.btn-text.danger:hover { color: var(--red); background: var(--red-soft); }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--sunken); }
.icon-btn .count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--violet); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
form.inline { display: inline; }

/* ---------- formularios ---------- */
.field > label, .label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.input { width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
textarea.input { resize: vertical; min-height: 46px; }
.input-soft { background: var(--sunken); border-color: transparent; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding: 13px 16px 13px 46px; border-radius: 16px; }

/* ---------- avisos ---------- */
.notice { padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.notice-error { background: var(--red-soft); border-color: #f7c9ca; color: #b42323; }
.notice-success { background: var(--green-soft); border-color: #b7ebcc; color: #0b6b36; }
.notice-info { background: var(--violet-soft); border-color: #ddd1ff; color: var(--violet-ink); }
.flashes { display: grid; gap: 8px; margin-bottom: 20px; }

/* ---------- etiquetas ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 700; background: var(--violet-soft); color: var(--violet-ink); }
.tag-grey { background: var(--sunken); color: var(--muted); }
.tag-dark { background: var(--ink); color: #fff; }
.tag-amber { background: var(--amber-soft); color: #8a5a00; }
.tag-green { background: var(--green-soft); color: #0b6b36; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); }
.chip:hover { border-color: var(--violet-3); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }

/* ---------- avatar e iconos ---------- */
.avatar { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar img, .avatar-initials { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; }
.avatar-initials { display: grid; place-items: center; background: var(--violet-soft); color: var(--violet-ink); font-weight: 700; }
.avatar-level { position: absolute; right: -4px; bottom: -4px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px; background: var(--violet); color: #fff; border: 2px solid #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.cicon { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 28%; color: #fff; font-weight: 800; font-family: var(--display);
  background: linear-gradient(135deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 40) 80% 45%)); }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 999px; display: grid; place-items: center;
  background: conic-gradient(var(--violet) calc(var(--p) * 1%), var(--line) 0); }
.ring > span { padding: 5px; background: #fff; border-radius: 999px; }

/* ---------- portadas ---------- */
.cover { aspect-ratio: 16 / 8; position: relative; overflow: hidden; background:
  radial-gradient(70% 90% at 15% 20%, hsl(var(--h, 262) 90% 82%) 0%, transparent 60%),
  radial-gradient(60% 90% at 85% 80%, hsl(calc(var(--h, 262) + 60) 90% 84%) 0%, transparent 60%),
  linear-gradient(135deg, hsl(var(--h, 262) 70% 92%), hsl(calc(var(--h, 262) + 30) 70% 88%)); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-video { aspect-ratio: 16 / 9; }
.r-md { border-radius: var(--r-md); }
.r-lg { border-radius: var(--r-lg); }
.lock { position: absolute; inset: 0; background: rgba(20,18,24,.66); color: #fff; display: grid; place-content: center; text-align: center; gap: 4px; font-weight: 700; font-size: 14px; backdrop-filter: blur(2px); }
.lock span:first-child { font-size: 24px; }
.corner { position: absolute; top: 10px; left: 10px; }
.corner-r { position: absolute; top: 10px; right: 10px; }

/* ---------- progreso y barras ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--violet); border-radius: 999px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bars .track { flex: 1; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--violet-soft); display: flex; align-items: flex-end; overflow: hidden; }
.bars .fill { width: 100%; border-radius: 4px 4px 0 0; background: var(--violet); min-height: 3px; }
.bars .fill.zero { background: transparent; min-height: 0; }
.bars .lbl { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.bars .bar.today .lbl { color: var(--violet); }

/* =====================================================================
   Estructura de la app: barra lateral | contenido | panel derecho
   ===================================================================== */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.shell.has-rail { grid-template-columns: 252px minmax(0, 1fr) 320px; }
.side { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 26px 18px; display: flex; flex-direction: column; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 18.5px; letter-spacing: -0.03em; padding: 0 8px; }
.brand-mark { width: 34px; height: 34px; border-radius: 999px; background: var(--violet); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 6px 16px -6px rgba(108,59,255,.8); }
.side-group > p { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 12px 8px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.side-link svg { flex-shrink: 0; color: var(--muted); }
.side-link:hover { background: var(--sunken); }
.side-link.active { color: var(--violet); font-weight: 600; background: var(--violet-soft); }
.side-link.active svg { color: var(--violet); }
.side-link .count { margin-left: auto; background: var(--violet); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.side-link.danger, .side-link.danger svg { color: var(--red); }
.side-community { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.side-community:hover { background: var(--sunken); }
.side-community.active { background: var(--violet-soft); font-weight: 600; }
.side-community small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.side-bottom { margin-top: auto; }
.main { padding: 28px clamp(16px, 3vw, 36px) 64px; min-width: 0; }
.rail { background: var(--surface); border-left: 1px solid var(--line); padding: 26px 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail-section + .rail-section { margin-top: 28px; }
.mobilebar { display: none; }

@media (max-width: 1200px) {
  .shell.has-rail { grid-template-columns: 252px minmax(0, 1fr); }
  .shell.has-rail .rail { grid-column: 2; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .shell, .shell.has-rail { grid-template-columns: minmax(0, 1fr); }
  .shell.has-rail .rail { grid-column: 1; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 40; height: 60px; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .side { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.18); }
  body.menu-open .side { transform: none; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,18,24,.35); z-index: 45; }
  .main { padding-top: 20px; }
}

/* ---------- cabecera de comunidad ---------- */
.chead { display: flex; align-items: center; gap: 14px; }
.chead h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 18px 0 24px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; }

/* =====================================================================
   Hero negro con destellos (elemento protagonista)
   ===================================================================== */
.hero-black { position: relative; overflow: hidden; background: var(--black); color: #fff; border-radius: var(--r-lg); padding: 30px 32px; min-height: 172px; display: flex; flex-direction: column; justify-content: center; isolation: isolate; }
.hero-black .kicker { font-size: 13px; color: rgba(255,255,255,.7); font-weight: 500; }
.hero-black h1, .hero-black h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); font-weight: 700; max-width: 560px; margin-top: 8px; }
.hero-black p.lead { color: rgba(255,255,255,.72); max-width: 520px; margin-top: 10px; }
.sparkles { position: absolute; right: 0; top: 0; bottom: 0; width: min(46%, 420px); z-index: -1; pointer-events: none; }
.sparkles use { fill: url(#spark-fill); }
.hero-big { border-radius: var(--r-xl); padding: clamp(36px, 6vw, 72px) clamp(24px, 5vw, 64px); min-height: 420px; }
.hero-big h1 { font-size: clamp(38px, 6.2vw, 74px); font-weight: 800; line-height: 1.0; letter-spacing: -0.04em; max-width: 760px; }
.hero-big .sparkles { width: min(52%, 620px); }
.hero-big .search { max-width: 560px; margin-top: 28px; }
.hero-big .search .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; padding-top: 16px; padding-bottom: 16px; }
.hero-big .search .input::placeholder { color: rgba(255,255,255,.55); }
.hero-big .search .input:focus { box-shadow: 0 0 0 4px rgba(108,59,255,.35); border-color: var(--violet-2); }
.hero-big .search svg { color: rgba(255,255,255,.6); }
@keyframes twinkle { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1); } }
.sparkles .tw { transform-box: fill-box; transform-origin: center; animation: twinkle 4.5s ease-in-out infinite; }
.sparkles .tw:nth-of-type(2) { animation-delay: 1.4s; }
.sparkles .tw:nth-of-type(3) { animation-delay: 2.6s; }

/* ---------- web pública ---------- */
.pub-top { position: sticky; top: 0; z-index: 30; background: rgba(243,242,247,.86); backdrop-filter: blur(12px); }
.pub-top-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-nav { display: flex; align-items: center; gap: 6px; }
.pub-nav a.lnk { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.pub-nav a.lnk:hover { background: var(--surface); }
@media (max-width: 600px) { .pub-nav .opt { display: none; } }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.pub-main { padding: 8px 0 72px; }
.pub-footer { padding: 32px 0 40px; color: var(--muted); font-size: 13.5px; }
.section { margin-top: clamp(56px, 8vw, 96px); }
.section-head { max-width: 640px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.035em; }
.section-head p { color: var(--muted); font-size: 16.5px; margin-top: 12px; }
.pill-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.pill-kicker b { background: var(--sunken); color: var(--ink); border-radius: 999px; padding: 2px 8px; font-weight: 700; }
.stats-row { display: flex; gap: clamp(24px, 5vw, 56px); margin-top: 32px; flex-wrap: wrap; }
.stats-row div b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.stats-row div span { color: rgba(255,255,255,.62); font-size: 13.5px; }

/* tarjetas de comunidad (descubrimiento) */
.ccard { position: relative; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--lift); display: flex; flex-direction: column; }
.ccard .cover { aspect-ratio: 16 / 8.5; }
.ccard .rank { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); color: var(--ink); font-weight: 800; font-size: 12.5px; border-radius: 999px; padding: 3px 10px; backdrop-filter: blur(6px); }
.ccard .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ccard h3 { font-size: 17.5px; font-weight: 700; letter-spacing: -0.02em; }
.ccard .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--muted); }
.ccard .price-tag { font-weight: 700; color: var(--ink); }

/* pasos (secuencia real) */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); counter-reset: step; }
.step { background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--lift); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-family: var(--display); margin-bottom: 16px; }
.step h3 { font-size: 19px; }
.step p { color: var(--muted); margin-top: 8px; font-size: 14.5px; }

/* funcionalidades */
.feat { background: var(--surface); border-radius: var(--r-lg); padding: 22px; border: 1px solid var(--line); }
.feat .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--violet-soft); display: grid; place-items: center; font-size: 19px; margin-bottom: 14px; }
.feat h3 { font-size: 17px; }
.feat p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.feat.feat-new { border-color: #ddd1ff; }

/* precios (referencia 2) */
.pricing { max-width: 920px; margin-left: auto; margin-right: auto; }
.pricing-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.plan { padding: 28px; border-radius: 22px; }
.plan.featured { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 40px -18px rgba(46,26,120,.25); }
.plan-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 18px; }
.plan-ico.dark { background: #3a3744; box-shadow: inset 0 0 0 7px #3a3744, inset 0 0 0 11px #fff; }
.plan-ico.glow { background: radial-gradient(circle, #fff 0 18%, #b9a8ff 30%, #ffb3dc 55%, #c9e6ff 75%, transparent 76%); }
.plan h3 { font-size: 19px; }
.plan .for { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.plan .amount { font-family: var(--display); font-size: 52px; font-weight: 700; letter-spacing: -0.04em; margin-top: 22px; line-height: 1; }
.plan .amount .dec { color: #c6c3d0; }
.plan .amount small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan .fee { font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.plan ul { border-top: 1px solid var(--line-2); margin-top: 22px; padding-top: 18px; display: grid; gap: 9px; font-size: 14px; color: var(--ink-2); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li::before { content: ""; width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; border-radius: 999px; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.1 4.8-4.8' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.plan .most { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 9px; }
.iri { background: var(--iridescent); border-radius: var(--r-xl); padding: clamp(28px, 5vw, 48px) 24px; text-align: center; margin-top: 8px; }
.iri h3 { font-size: clamp(20px, 2.4vw, 26px); }
.iri p { color: var(--ink-2); margin-top: 6px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth .card { border-radius: var(--r-xl); padding: 32px; box-shadow: var(--lift); border-color: transparent; }

/* =====================================================================
   Panel del alumno
   ===================================================================== */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--lift); }
.tile .tico { width: 40px; height: 40px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex-shrink: 0; font-size: 17px; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-weight: 700; font-size: 14.5px; }
.course-card { background: var(--surface); border-radius: 18px; padding: 10px; box-shadow: var(--lift); display: flex; flex-direction: column; }
.course-card .cover { border-radius: 12px; aspect-ratio: 16 / 9.5; }
.course-card .body { padding: 12px 6px 6px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.course-card h3 { font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.course-card .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-top: auto; padding-top: 4px; }
.course-card .who b { display: block; font-size: 12.5px; }
.course-card .who span { color: var(--muted); font-size: 11.5px; }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 12px; margin: -4px -4px 0; scrollbar-width: thin; }
.carousel > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .carousel { grid-auto-columns: calc((100% - 28px) / 3); } }
.table-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 18px 8px; }
.table td { padding: 12px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fcfbff; }
@media (max-width: 640px) { .table .hide-sm { display: none; } }
.date-box { width: 58px; flex-shrink: 0; border-radius: 14px; background: var(--violet-soft); color: var(--violet-ink); display: grid; place-content: center; text-align: center; padding: 8px 0; }
.date-box b { font-size: 22px; line-height: 1; font-family: var(--display); }
.date-box small { font-size: 11px; font-weight: 700; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.person + .person { border-top: 1px solid var(--line); }
.person b { display: block; font-size: 14px; }
.person .grow > span { font-size: 12px; color: var(--muted); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.badge-item { text-align: center; padding: 12px 6px; border-radius: 14px; background: var(--sunken); }
.badge-item .b-ico { font-size: 24px; line-height: 1; }
.badge-item b { display: block; font-size: 11.5px; margin-top: 6px; line-height: 1.25; }
.badge-item.off { opacity: .38; filter: grayscale(1); }
.streak { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--iridescent); }
.streak b { font-family: var(--display); font-size: 28px; line-height: 1; }

/* ---------- comunidad: feed y post ---------- */
.post-head { display: flex; align-items: center; gap: 12px; }
.post-title { font-family: var(--font); font-size: 17.5px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.post-actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.composer-title { font-weight: 700; font-size: 16px !important; }
.comment { display: flex; gap: 12px; }
.bubble { background: var(--sunken); border-radius: 16px; padding: 10px 14px; }
.lesson-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.lesson-link:hover { background: var(--sunken); }
.lesson-link.current { background: var(--violet-soft); color: var(--violet-ink); font-weight: 700; }
.tick { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--line-2); flex-shrink: 0; display: grid; place-items: center; font-size: 11px; color: #fff; }
.tick.done { background: var(--green); border-color: var(--green); }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); }
.video { aspect-ratio: 16 / 9; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.card > .video:first-child { border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; overflow: hidden; }
.two-col { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .two-col { grid-template-columns: 290px minmax(0, 1fr); } .sticky { position: sticky; top: 24px; } }
.levels { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.level-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.level-box.reached { background: var(--violet-soft); border-color: #ddd1ff; }
.rank-n { width: 30px; text-align: center; font-weight: 800; color: var(--muted); }
.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--sunken); }
.segmented a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- métricas ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.kpi { background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--lift); }
.kpi .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.05; }
.kpi .d { font-size: 12.5px; margin-top: 6px; color: var(--muted); }
.kpi .up { color: var(--green); font-weight: 700; }
.kpi .down { color: var(--red); font-weight: 700; }
.kpi.dark { background: var(--black); color: #fff; }
.kpi.dark .k, .kpi.dark .d { color: rgba(255,255,255,.65); }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.chart .colstack { flex: 1; width: 100%; max-width: 40px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chart .seg { border-radius: 4px; min-height: 0; }
.chart .seg.a { background: var(--violet); }
.chart .seg.b { background: #17a37b; }
.chart .seg.neg { background: #f3b6b7; }
.chart .lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart .num { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- mensajes ---------- */
.inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 92px); min-height: 520px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.inbox-list a { display: flex; gap: 12px; padding: 14px 16px; align-items: center; border-bottom: 1px solid var(--line); }
.inbox-list a:hover { background: var(--sunken); }
.inbox-list a.active { background: var(--violet-soft); }
.inbox-list a .unread { width: 9px; height: 9px; border-radius: 999px; background: var(--violet); flex-shrink: 0; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.thread-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: #fbfaff; }
.msg { max-width: min(76%, 520px); padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--violet); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.msg.mine a { color: #fff; text-decoration: underline; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.thread-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.thread-form textarea { max-height: 160px; }
@media (max-width: 760px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread-body { min-height: 55vh; max-height: 65vh; }
}

/* ---------- certificado ---------- */
.cert-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.cert { width: min(100%, 980px); aspect-ratio: 1.414; background: #fff; border-radius: 22px; position: relative; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(46,26,120,.35); display: flex; flex-direction: column; padding: clamp(24px, 5vw, 64px); container-type: inline-size; }
.cert::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 34%; background: var(--iridescent); opacity: .9; }
.cert > * { position: relative; }
.cert .cert-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cert .cert-title { margin-top: auto; padding-top: 24px; }
.cert .cert-title p { color: var(--muted); font-size: clamp(12px, 1.6cqw, 16px); }
.cert .cert-title p.name { color: var(--ink); }
.cert .cert-title p.course { color: var(--ink); }
.cert .cert-title .name { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 7cqw, 72px); letter-spacing: -0.04em; line-height: 1; margin: 10px 0 14px; }
.cert .cert-title .course { font-size: clamp(15px, 2.4cqw, 24px); font-weight: 600; max-width: 80%; }
.cert .cert-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-top: 1px solid var(--line-2); padding-top: 18px; font-size: clamp(11px, 1.4cqw, 14px); }
.cert .cert-foot b { display: block; font-size: clamp(12px, 1.6cqw, 15px); }
.cert .seal { width: clamp(64px, 11cqw, 110px); aspect-ratio: 1; border-radius: 999px; background: var(--black); color: #fff; display: grid; place-items: center; text-align: center; font-size: clamp(9px, 1.2cqw, 12px); font-weight: 700; line-height: 1.2; box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--line-2); }
.cert-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  .cert-page { padding: 0; min-height: 0; }
  .cert { width: 100%; box-shadow: none; border-radius: 0; }
  .cert-actions, .flashes { display: none !important; }
}

/* contenido + columna lateral (se apila en móvil) */
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr) 340px; } }

.chart .col:hover .seg { filter: brightness(1.12); }
.chart .col { cursor: default; }
details.table-view summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 14px; }
details.table-view table { margin-top: 8px; }
.brand { white-space: nowrap; }
@media (max-width: 600px) { .pub-top .brand { font-size: 16px; } .pub-top .brand-mark { width: 30px; height: 30px; } }
@media (min-width: 900px) { .hero-big h1 { max-width: min(760px, 62%); } .hero-big .lead { max-width: min(560px, 55%); } }
