/* Portal Ruta Alfa · Alfacreart — minimalista, tema oscuro por defecto */
:root,
:root[data-tema="oscuro"] {
  --bg: #0a0a24;
  --bg-2: #0e0e30;
  --panel: #121238;
  --panel-2: #181847;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f2f3ff;
  --ink-2: #c9cbec;
  --muted: #9193bd;
  --acc: #7a69ff;
  --acc-2: #3dc2eb;
  --acc-soft: rgba(122, 105, 255, .16);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .14);
  --warn: #ffc857;
  --warn-soft: rgba(255, 200, 87, .14);
  --sombra: 0 10px 30px rgba(0, 0, 0, .28);
  --glow: 0 0 60px rgba(122, 105, 255, .35);
}
:root[data-tema="claro"] {
  --bg: #f5f6fd;
  --bg-2: #eef0fb;
  --panel: #ffffff;
  --panel-2: #f3f4fc;
  --line: #e1e4f6;
  --line-2: #cfd3ee;
  --ink: #14143a;
  --ink-2: #34365e;
  --muted: #6a6d92;
  --acc: #4b3bcf;
  --acc-2: #3dc2eb;
  --acc-soft: rgba(75, 59, 207, .10);
  --ok: #12945f;
  --ok-soft: rgba(18, 148, 95, .12);
  --warn: #b97a00;
  --warn-soft: rgba(185, 122, 0, .12);
  --sombra: 0 10px 30px rgba(40, 40, 120, .08);
  --glow: 0 0 50px rgba(75, 59, 207, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
.ico { flex: none; }
em { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 600; font-size: 1.08em; }
:focus-visible { outline: 2px solid var(--acc-2); outline-offset: 2px; border-radius: 8px; }

/* Estructura */
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.cuerpo { min-width: 0; display: flex; flex-direction: column; }

/* Menú lateral */
.lado {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 22px 16px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.marca span { display: flex; flex-direction: column; line-height: 1.15; }
.marca b { font-size: 17px; letter-spacing: .01em; }
.marca small { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 500; font-size: 15px;
  transition: background .2s, color .2s;
}
.menu a:hover:not(.off) { background: var(--panel-2); }
.menu a.on { background: var(--acc-soft); color: var(--ink); }
.menu a.on .ico { color: var(--acc); }
.menu a.off { color: var(--muted); cursor: default; }
.menu a em { margin-left: auto; font-family: inherit; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-2); padding: 1px 8px; border-radius: 99px; }
.tema {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.tema:hover { background: var(--panel-2); }
.tema span { display: inline-flex; align-items: center; gap: 10px; }
:root[data-tema="oscuro"] .t-claro, :root[data-tema="claro"] .t-oscuro { display: none; }

/* Barra superior */
.barra {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.barra-d { display: flex; align-items: center; gap: 12px; }
.chip-nivel, .racha {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 600;
}
.chip-nivel, .racha { white-space: nowrap; }
@media (max-width: 480px) { .chip-nivel, .racha { padding: 6px 10px; font-size: 13px; } .barra-d { gap: 8px; } }
.chip-nivel { background: var(--acc-soft); color: var(--ink); }
.chip-nivel .ico { color: var(--acc-2); }
.racha { background: var(--warn-soft); color: var(--warn); }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line-2); border-radius: 12px; color: var(--ink-2); }
.icon-btn:hover { background: var(--panel-2); }
.punto { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--acc-2); }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc-2)); }

/* Página */
.pagina {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px;
  padding: 28px clamp(16px, 3vw, 32px) 40px;
  max-width: 1240px; width: 100%; margin: 0 auto;
}
.col-principal, .col-lado { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.tarjeta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--sombra);
}
.tarjeta h2 { font-size: 19px; font-weight: 700; letter-spacing: -.005em; }
.sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mini { color: var(--muted); font-size: 13px; font-weight: 600; }

/* Botones */
.acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; letter-spacing: .005em;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn.primario { color: #fff; background: linear-gradient(135deg, var(--acc), #4b8bff 60%, var(--acc-2)); box-shadow: 0 8px 24px rgba(75, 91, 255, .35); }
.btn.primario:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(75, 91, 255, .45); }
.btn.fantasma { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.fantasma:hover:not(:disabled) { background: var(--panel-2); }
.btn.fantasma:disabled { opacity: .55; }
.btn.ancho { width: 100%; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; align-items: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; right: -80px; top: -90px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, var(--acc-soft), transparent 65%); pointer-events: none;
}
.eyebrow { color: var(--acc-2); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.saludo { color: var(--ink-2); font-weight: 500; letter-spacing: .03em; min-height: 1.5em; }
.saludo .nom { color: var(--acc-2); font-weight: 800; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -.15em; background: var(--acc-2); animation: parpadeo 1s steps(1) infinite; }
@keyframes parpadeo { 50% { opacity: 0; } }
.hero h1 { font-size: clamp(27px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; margin-top: 8px; }
.hero h1 em { color: var(--acc-2); }
.lead { color: var(--ink-2); font-size: 17px; margin-top: 12px; max-width: 52ch; }
.garantia { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 18px; }
.garantia .ico { color: var(--ok); margin-top: 2px; }

.hero-anillo { position: relative; width: 210px; justify-self: center; text-align: center; }
.anillo { width: 190px; height: 190px; transform: rotate(-90deg); display: block; margin: 0 auto; }
.anillo circle { fill: none; stroke-width: 10; }
.anillo .pista { stroke: var(--line-2); }
.anillo .avance { stroke: url(#g-anillo); stroke-linecap: round; stroke-dasharray: 364.4; stroke-dashoffset: 364.4; transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 8px rgba(122, 105, 255, .5)); }
.anillo-c { position: absolute; top: 0; left: 0; right: 0; height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anillo-c strong { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.anillo-c small { font-size: 20px; font-weight: 700; margin-left: 2px; color: var(--ink-2); }
.anillo-c > span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.anillo-pie { margin-top: 10px; color: var(--ink-2); font-size: 14px; }

/* Guía */
.guia { padding: 0; }
.guia summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; cursor: pointer; font-size: 15.5px; color: var(--ink-2); }
.guia summary::-webkit-details-marker { display: none; }
.guia summary b { color: var(--ink); }
.gira { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); transition: transform .25s; flex: none; color: var(--muted); }
details[open] > summary .gira { transform: rotate(180deg); }
.tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 4px 24px 22px; }
.tres li { display: flex; gap: 12px; align-items: flex-start; background: var(--panel-2); border-radius: 16px; padding: 14px; color: var(--ink-2); font-size: 14.5px; }
.tres b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--acc-soft); color: var(--acc-2); font-size: 14px; }

/* Paso actual */
.actual-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.num { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--acc-2); }
.modulo { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 10px; }
.actual h2 { font-size: clamp(22px, 2.4vw, 27px); font-weight: 800; letter-spacing: -.015em; }
.barra-prog { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 18px; }
.barra-prog.fina { height: 6px; margin-top: 10px; }
.barra-prog i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.barra-prog.vis i { width: var(--w); }
.prog-txt { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.tareas { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.tarea { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid transparent; }
.marca-t { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); }
.t-nombre { flex: 1; font-size: 15.5px; font-weight: 500; min-width: 0; }
.t-estado { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: var(--muted); border: 1px solid var(--line-2); }
.tarea.hecha .marca-t { background: var(--ok); border-color: var(--ok); color: #05281a; }
.tarea.hecha .t-nombre { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.tarea.hecha .t-estado { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tarea.revision { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.tarea.revision .marca-t { border-color: var(--warn); color: var(--warn); }
.tarea.revision .t-estado { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

/* Premios */
.nota-ej { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-2); padding: 2px 10px; border-radius: 99px; }
.proximo { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, var(--acc-soft), transparent); border: 1px solid var(--line-2); }
.p-ico { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; box-shadow: var(--glow); }
.p-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-txt small { color: var(--acc-2); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.p-txt b { font-size: 17px; }
.p-txt > span { color: var(--muted); font-size: 14px; }
.estante { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.p-btn { width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.premio.abierto .p-btn:hover { transform: translateY(-3px); border-color: var(--acc); }
.p-circ { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 6px; }
.premio.abierto .p-circ { background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; }
.premio.cerrado .p-circ { background: var(--line); color: var(--muted); }
.premio.cerrado .p-btn { opacity: .65; }
.p-btn b { font-size: 14.5px; line-height: 1.25; }
.p-btn small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.pie-nota { color: var(--muted); font-size: 12.5px; margin-top: 14px; }

/* Video */
.v-cab { display: flex; gap: 14px; align-items: center; }
.v-cab p { color: var(--muted); font-size: 14.5px; }
.v-play { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--acc-soft); color: var(--acc-2); flex: none; }
.v-hueco { margin-top: 16px; aspect-ratio: 16 / 7; border-radius: 16px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: 14px; background: repeating-linear-gradient(135deg, transparent 0 14px, var(--line) 14px 15px); }

/* Ruta (columna derecha) */
.niveles { margin-top: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.niveles::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 2px; background: var(--line-2); border-radius: 2px; }
.nivel { position: relative; padding-left: 36px; }
.n-punto { position: absolute; left: 0; top: 18px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--line-2); color: var(--muted); }
.nivel.completo .n-punto { background: var(--ok); border-color: var(--ok); color: #05281a; }
.nivel.actual .n-punto { border-color: var(--acc-2); box-shadow: 0 0 0 5px var(--acc-soft); }
.nivel.actual .n-punto::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acc-2); }
.nivel details { background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; }
.nivel.actual details { border-color: color-mix(in srgb, var(--acc-2) 55%, transparent); }
.nivel summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.nivel summary::-webkit-details-marker { display: none; }
.n-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--acc-soft); color: var(--acc-2); }
.nivel.bloqueado .n-ico { background: var(--line); color: var(--muted); }
.nivel.completo .n-ico { background: var(--ok-soft); color: var(--ok); }
.n-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.n-txt b { font-size: 16px; }
.n-txt small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.n-prog { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.n-prog i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.n-prog i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.nivel.vis .n-prog i::after { width: var(--w); }
.n-prog em { font-family: inherit; font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); width: 34px; text-align: right; }
.n-pasos { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.n-pasos li { border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.n-pasos li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; width: 100%; }
.n-pasos li a:hover { background: var(--acc-soft); }
.n-pasos .pi { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); color: var(--muted); }
.n-pasos li.completo .pi { background: var(--ok); border-color: var(--ok); color: #05281a; }
.n-pasos li.completo { color: var(--muted); }
.n-pasos li.actual { background: var(--acc-soft); color: var(--ink); font-weight: 600; }
.n-pasos li.actual .pi { border-color: var(--acc-2); }
.n-pasos li.bloqueado { color: var(--muted); }

.semana ul { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.semana li { display: flex; gap: 12px; align-items: flex-start; }
.semana .ico { color: var(--acc-2); margin-top: 2px; }
.semana li span { display: flex; flex-direction: column; font-size: 15px; }
.semana small { color: var(--muted); font-size: 13px; }

.comunidad { text-align: left; }
.c-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--acc-soft); color: var(--acc-2); margin-bottom: 12px; }
.comunidad p { color: var(--muted); font-size: 14.5px; margin: 6px 0 16px; }

/* Pie */
.pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 18px clamp(16px, 3vw, 32px) 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.demo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.demo a { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); font-weight: 600; color: var(--ink-2); }
.demo a.on { background: var(--acc-soft); border-color: var(--acc); color: var(--ink); }

/* Aviso y confeti */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px); opacity: 0; z-index: 60; max-width: min(92vw, 460px); display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--acc); color: var(--ink); box-shadow: var(--sombra), var(--glow); font-weight: 600; transition: opacity .35s, transform .35s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
#confeti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* Menú inferior (móvil) */
.inferior { display: none; }

/* Entrada suave */
.tarjeta { animation: sube .6s cubic-bezier(.2, .8, .2, 1) both; }
.col-principal > :nth-child(2) { animation-delay: .06s; }
.col-principal > :nth-child(3) { animation-delay: .12s; }
.col-principal > :nth-child(4) { animation-delay: .18s; }
.col-lado > :nth-child(1) { animation-delay: .1s; }
.col-lado > :nth-child(2) { animation-delay: .16s; }
.col-lado > :nth-child(3) { animation-delay: .22s; }
@keyframes sube { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Responsivo */
@media (max-width: 1100px) {
  .pagina { grid-template-columns: minmax(0, 1fr); }
  .col-lado { order: 2; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .lado { display: none; }
  .barra { position: static; }
  .pagina { padding-bottom: 96px; }
  .inferior {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    justify-content: space-around; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .inferior a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px 14px; border-radius: 12px; }
  .inferior a.on { color: var(--ink); background: var(--acc-soft); }
  .inferior a.on .ico { color: var(--acc-2); }
  .pie { padding-bottom: 100px; }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-anillo { order: -1; width: 100%; display: flex; align-items: center; gap: 16px; text-align: left; }
  .anillo, .anillo-c { width: 112px; height: 112px; margin: 0; }
  .anillo-c { position: absolute; left: 0; top: 0; right: auto; }
  .anillo-c strong { font-size: 28px; }
  .anillo-c small { font-size: 14px; }
  .anillo-c > span { display: none; }
  .anillo-pie { margin: 0 0 0 128px; font-size: 15px; }
  .hero-anillo { min-height: 112px; }
  .tres { grid-template-columns: 1fr; }
  .acciones .btn { width: 100%; }
  .t-estado { display: none; }
  .tarea.revision .t-estado, .tarea.hecha .t-estado { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tarjeta { animation: none; }
  .barra-prog i, .n-prog i::after, .anillo .avance, .toast { transition: none; }
}
