/* Inicio. Tokens, armazón y botones vienen de app.css. */

/* ---------- Menú de la propuesta (header) ---------- */
.top-menu { display: flex; align-items: center; gap: 2px; }
.top-menu a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 9px;
  color: var(--text-primary); text-decoration: none; font-size: 14.5px; font-weight: 550; white-space: nowrap;
}
.top-menu a:hover { background: var(--background); color: var(--primary-dark); }
.top-menu a.activo { color: var(--primary); background: var(--primary-soft); }
.top-cta { min-height: 40px; padding: 6px 16px; margin-left: 8px; white-space: nowrap; }
html { scroll-behavior: smooth; }
.home [id] { scroll-margin-top: calc(var(--header-h) + 18px); }
main.home { padding-top: 16px; }

/* ---------- Banner ---------- */
.banner {
  --tinta: #EAF1FF;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: stretch;
  min-height: clamp(500px, calc(100dvh - 150px), 640px);
  border-radius: 22px; color: #fff;
  background:
    radial-gradient(60% 80% at 82% 58%, rgba(59, 130, 246, .42) 0%, rgba(59, 130, 246, 0) 70%),
    radial-gradient(45% 60% at 8% 0%, rgba(99, 102, 241, .38) 0%, rgba(99, 102, 241, 0) 70%),
    radial-gradient(50% 60% at 55% 110%, rgba(20, 184, 166, .22) 0%, rgba(20, 184, 166, 0) 70%),
    linear-gradient(135deg, #0B1B36 0%, #12284A 48%, #0E2145 100%);
  box-shadow: 0 24px 60px -28px rgba(11, 27, 54, .65);
}
.banner-fondo { position: absolute; inset: 0; z-index: -1; }
/* Papel cuadriculado, que se desvanece hacia los bordes */
.banner-fondo::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(90% 90% at 60% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(90% 90% at 60% 50%, #000 30%, transparent 100%);
}
.banner-curvas { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; }
.banner-curvas .c1 { stroke: rgba(125, 211, 252, .30); stroke-width: 1.6; stroke-dasharray: 2200; animation: trazo 5s ease-out both; }
.banner-curvas .c2 { stroke: rgba(165, 180, 252, .26); stroke-width: 1.6; stroke-dasharray: 2200; animation: trazo 5s .4s ease-out both; }
.banner-curvas .c3 { stroke: rgba(255, 255, 255, .10); stroke-width: 1.2; }
.banner-curvas .c4 { stroke: rgba(94, 234, 212, .20); stroke-width: 1.4; stroke-dasharray: 6 9; }
@keyframes trazo { from { stroke-dashoffset: 2200; } to { stroke-dashoffset: 0; } }

/* Collage: cada fórmula es un .fx colocado en % del banner (datos en home.js) */
.collage { position: absolute; inset: 0; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.fx {
  position: absolute; left: var(--x); top: var(--y); white-space: nowrap;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  font-size: var(--s, 18px); color: var(--tinta);
  opacity: 0; animation: aparecer .9s var(--d, 0s) ease-out forwards;
}
.fx > .fx-in { display: block; animation: flotar var(--t, 9s) var(--d, 0s) ease-in-out infinite alternate; }
.fx .katex { font-size: 1em; }
/* Tinta: fórmulas sueltas, como escritas con tiza */
.fx.tinta { --op: .2; text-shadow: 0 0 18px rgba(147, 197, 253, .35); }
.fx.tinta.fuerte { --op: .42; }
/* Ficha: fórmula destacada en vidrio, con el nombre de su área */
.fx.ficha { --op: 1; }
.fx.ficha .fx-in {
  padding: 10px 16px 12px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .20);
  box-shadow: 0 14px 34px -14px rgba(3, 10, 26, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fx.ficha .area {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font: 600 10.5px/1.2 var(--font); letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .72);
}
.fx.ficha .area i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #7DD3FC); box-shadow: 0 0 10px var(--c, #7DD3FC); }
.fx.movil { display: none; }
@keyframes aparecer { from { opacity: 0; filter: blur(6px); } to { opacity: var(--op, 1); filter: none; } }
@keyframes flotar { from { transform: translateY(-5px); } to { transform: translateY(6px); } }

/* Texto */
.banner-copy {
  position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; min-width: 0;
  padding: clamp(28px, 4vw, 56px); padding-right: 0;
}
/* Velo para que el texto se lea sobre el collage */
.banner-copy::before {
  content: ""; position: absolute; inset: 0 -22% 0 0; z-index: -1;
  background: linear-gradient(90deg, rgba(11, 27, 54, .86) 0%, rgba(11, 27, 54, .72) 58%, rgba(11, 27, 54, 0) 100%);
}
.sobre {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start; margin: 0 0 18px; padding: 6px 14px 6px 11px;
  border-radius: 99px; border: 1px solid rgba(255, 255, 255, .20); background: rgba(255, 255, 255, .08);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #DCE7FA;
}
.sobre .punto { width: 8px; height: 8px; border-radius: 50%; background: #5EEAD4; box-shadow: 0 0 0 4px rgba(94, 234, 212, .22); }
.banner h1 {
  margin: 0 0 16px; color: #fff; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.04; font-weight: 760; letter-spacing: -.028em;
}
.banner h1 em {
  font-style: normal; white-space: nowrap;
  background: linear-gradient(90deg, #7DD3FC, #A5B4FC 55%, #5EEAD4); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.banner .lead { margin: 0 0 26px; max-width: 33em; color: #D3DEF1; font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn.claro { background: #fff; color: var(--primary-dark); border-color: #fff; }
.btn.claro:hover:not(:disabled), .btn.claro:active:not(:disabled) { background: #E3ECFB; border-color: #E3ECFB; }
.btn.vidrio { background: rgba(255, 255, 255, .10); color: #fff; border-color: rgba(255, 255, 255, .42); }
.btn.vidrio:hover:not(:disabled), .btn.vidrio:active:not(:disabled) { background: rgba(255, 255, 255, .20); border-color: #fff; }
.enlace-claro { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: #DCE7FA; font-weight: 600; font-size: 15px; text-underline-offset: 4px; }
.enlace-claro:hover { color: #fff; }
.banner :focus-visible { outline-color: #fff; }
#introBtn .i-pause, #introBtn.is-playing .i-play { display: none; }
#introBtn.is-playing .i-pause { display: inline; }
.intro-bar { height: 4px; margin-top: 20px; max-width: 320px; border-radius: 2px; background: rgba(255, 255, 255, .25); opacity: 0; transition: opacity .3s; }
.intro-bar.on { opacity: 1; }
.intro-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: #7DD3FC; }

/* Claudia sobre un halo claro */
.banner-claudia { position: relative; z-index: 1; min-width: 0; container-type: size; margin-top: 34px; }
.banner-claudia::before {
  content: ""; position: absolute; left: 50%; bottom: -12%; width: 86%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(219, 234, 254, .34) 0%, rgba(147, 197, 253, .16) 55%, rgba(147, 197, 253, 0) 100%);
}
.banner-claudia video { cursor: pointer; }
.banner.sin-video { grid-template-columns: 1fr; }
.banner.sin-video .banner-claudia, .banner.sin-video #introBtn, .banner.sin-video .intro-bar { display: none; }

/* ---------- Cifras ---------- */
.cifras {
  list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.cifras li { padding: 18px 22px; display: grid; gap: 2px; }
.cifras li + li { border-left: 1px solid var(--border); }
.cifras b { font-size: 30px; line-height: 1.1; font-weight: 740; letter-spacing: -.02em; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.cifras span { font-size: 14.5px; color: var(--text-secondary); line-height: 1.4; }

/* ---------- Secciones ---------- */
.block { margin-top: clamp(44px, 6vw, 76px); }
.sobre-sec { margin: 0 0 6px; font-size: 13px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--primary); }
.block h2 { margin: 0 0 18px; font-size: clamp(24px, 2.5vw, 32px); font-weight: 720; line-height: 1.15; letter-spacing: -.02em; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.card .ic-caja { width: 44px; height: 44px; border-radius: 12px; }
.card .ic-caja .ic { width: 24px; height: 24px; }
.card h3 { margin: 16px 0 6px; font-size: 18.5px; font-weight: 680; line-height: 1.3; }
.card p { margin: 0; color: var(--text-secondary-strong); font-size: 16px; }

.levels { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.levels li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: center; padding: 16px 18px; background: var(--primary-soft); border-radius: var(--radius); }
.levels .ic { grid-row: 1 / span 2; align-self: start; width: 26px; height: 26px; margin-top: 2px; color: var(--primary); }
.levels b { display: block; font-size: 17px; color: var(--primary-dark); }
.levels span { color: var(--text-secondary-strong); font-size: 15.5px; line-height: 1.45; }

.prof p:not(.sobre-sec) { margin: 0; max-width: 46em; font-size: 17px; }
.prog-teaser { margin: -8px 0 20px; max-width: 46em; font-size: 17px; color: var(--text-secondary-strong); }

/* Áreas del programa: una fórmula emblemática por área (home.js) */
.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.area-t {
  position: relative; display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; min-height: 132px; padding: 16px 18px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.area-t::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.area-t:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--c); }
.area-t header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.area-t b { font-size: 16.5px; color: var(--primary-dark); }
.area-t small { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.area-t .f { align-self: center; justify-self: center; max-width: 100%; overflow: hidden; font-size: 17px; color: var(--text-primary); }

/* ---------- Planes ---------- */
.planes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 26px 24px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.plan h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary-strong); }
.precio { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 6px; color: var(--primary-dark); }
.precio b { font-size: 56px; line-height: 1; font-weight: 760; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.precio b.gratis { font-size: 38px; line-height: 56px; letter-spacing: -.02em; }
.precio .moneda { font-size: 20px; font-weight: 650; align-self: flex-start; margin-top: 6px; }
.precio .per { font-size: 17px; font-weight: 550; color: var(--text-secondary); }
.plan-nota { margin: 0 0 18px; min-height: 3em; font-size: 15.5px; color: var(--text-secondary-strong); }
.incluye { list-style: none; margin: 0; padding: 18px 0 0; display: grid; gap: 10px; border-top: 1px solid var(--border); font-size: 15.5px; }
.incluye li { position: relative; padding-left: 28px; }
.incluye li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--success-soft);
}
.incluye li::after {
  content: ""; position: absolute; left: 6.5px; top: 6.5px; width: 5px; height: 9px; border: solid var(--success); border-width: 0 2px 2px 0; transform: rotate(40deg);
}
.plan.destacado {
  color: #E3ECFB; border-color: transparent;
  background: radial-gradient(90% 70% at 100% 0%, rgba(59, 130, 246, .5) 0%, rgba(59, 130, 246, 0) 70%), linear-gradient(150deg, #0E2145, #183153);
  box-shadow: 0 26px 50px -26px rgba(11, 27, 54, .7);
}
.plan.destacado h3 { color: #A9C1EA; }
.plan.destacado .precio { color: #fff; }
.plan.destacado .precio .per, .plan.destacado .plan-nota { color: #C5D4EE; }
.plan.destacado .incluye { border-color: rgba(255, 255, 255, .18); }
.plan.destacado .incluye li::before { background: rgba(94, 234, 212, .2); }
.plan.destacado .incluye li::after { border-color: #5EEAD4; }
.cinta { position: absolute; top: 20px; right: 20px; padding: 5px 12px; border-radius: 99px; background: #5EEAD4; color: #06302B; font-size: 13px; font-weight: 700; }
.plan.docente { background: var(--primary-soft); border-color: #CFE0FC; }
.plan.docente .incluye { border-color: #CFE0FC; }
.plan .enlace { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: 15px; }
.aviso-planes { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px dashed var(--border-strong); font-size: 15px; color: var(--text-secondary-strong); }
.aviso-planes .ic { margin-top: 2px; color: var(--primary); }
.aviso-planes a { font-weight: 600; }

/* ---------- Instituciones ---------- */
.franja { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 3vw, 44px); align-items: center; padding: clamp(22px, 3.2vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.franja-texto p:not(.sobre-sec) { margin: 0; font-size: 17px; color: var(--text-secondary-strong); }
.franja h2 { margin-bottom: 12px; }
.puntos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: p; }
.puntos li { counter-increment: p; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--background); }
.puntos li::before { content: counter(p); grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-dark); color: #fff; font-weight: 700; }
.puntos b { color: var(--primary-dark); font-size: 16.5px; }
.puntos span { font-size: 15px; color: var(--text-secondary-strong); line-height: 1.45; }

/* ---------- Docentes y patrocinio ---------- */
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { padding: clamp(22px, 3vw, 34px); border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.panel .ic-caja { width: 46px; height: 46px; border-radius: 13px; margin-bottom: 16px; }
.panel h2 { margin-bottom: 10px; font-size: clamp(22px, 2.1vw, 27px); }
.panel p:not(.sobre-sec) { margin: 0; font-size: 16.5px; color: var(--text-secondary-strong); }
.panel .estado-prog { margin-top: 16px !important; display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--warning-soft); color: var(--warning-strong) !important; font-size: 13.5px !important; font-weight: 600; }
.panel.oscuro { border-color: transparent; background: radial-gradient(80% 80% at 0% 100%, rgba(20, 184, 166, .28) 0%, rgba(20, 184, 166, 0) 70%), linear-gradient(150deg, #183153, #0E2145); }
.panel.oscuro h2 { color: #fff; }
.panel.oscuro .sobre-sec { color: #7DD3FC; }
.panel.oscuro p:not(.sobre-sec) { color: #CBD8EE; }
.panel.oscuro .ic-caja { background: rgba(255, 255, 255, .12); color: #7DD3FC; }
.panel.oscuro .estado-prog { background: rgba(94, 234, 212, .16); color: #99F6E4 !important; }

/* ---------- Cierre ---------- */
.cta-caja {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px;
  padding: clamp(22px, 3vw, 34px); border-radius: 18px;
  background: var(--primary-dark); color: #fff;
}
.cta-caja h2 { margin: 0 0 4px; color: #fff; }
.cta-caja p { margin: 0; max-width: 34em; color: #D6E0EE; font-size: 16px; }
.cta-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-caja .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.cta-caja .btn.ghost:hover:not(:disabled), .cta-caja .btn.ghost:active:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: #fff; }
.cta-caja :focus-visible { outline-color: #fff; }
.pie { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 40px; padding: 20px 2px 8px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-secondary-strong); }
.pie strong { letter-spacing: .08em; color: var(--primary-dark); }
.pie-der { margin-left: auto; }

/* ---------- Adaptación ---------- */
@media (max-width: 1280px) { .top-menu { display: none; } }
@media (max-width: 980px) {
  .planes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan.docente { grid-column: 1 / -1; }
  .franja { grid-template-columns: 1fr; }
  .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cifras li:nth-child(3) { border-left: 0; }
  .cifras li:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .banner { grid-template-columns: 1fr; min-height: 0; }
  .banner-claudia { order: -1; height: min(40dvh, 300px); margin-top: 20px; }
  /* En columna, Claudia va centrada: ventana más estrecha del video (como .cv.centrada de app.css) */
  .banner-claudia .cv { --win: .48; --off: .215; }
  .banner-copy { padding: 8px 22px 30px; }
  .banner-copy::before { inset: -40px 0 0 0; background: linear-gradient(180deg, rgba(11, 27, 54, 0) 0%, rgba(11, 27, 54, .82) 22%); }
  .fx.ancho, .fx.ficha:not(.movil) { display: none; }
  .fx.movil { display: block; }
  .fx.ficha .fx-in { padding: 7px 11px 9px; border-radius: 11px; }
  .fx.ficha .area { font-size: 9px; }
  .cards, .levels, .dos { grid-template-columns: 1fr; }
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .top-cta { display: none; }
  .banner { border-radius: 18px; }
  .hero-actions .btn, .cta-acciones .btn { flex: 1 1 100%; }
  .cta-acciones { width: 100%; }
  .intro-bar { max-width: none; }
  .planes, .areas { grid-template-columns: 1fr; }
  .plan-nota { min-height: 0; }
  .precio b { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fx { animation: none; opacity: var(--op, 1); }
  .fx > .fx-in, .banner-curvas path { animation: none; }
  .collage, .card, .area-t { transition: none; }
}
