/* =============================================================
   Público express (Etapa 6): cabecera, landing, pie, fichas de producto, páginas de error y legales.
   Solo presentación. Se carga al final (ver pages/_document.js) para imponerse a las hojas de plantilla.
   Usa los tokens de global/css/style.css (--ui-navy, --ui-ease, --color-*, --shadow-card).
   ============================================================= */

html { scroll-behavior: smooth; }
::selection { background: var(--brand-primary, #fdc500); color: #1d1d1b; }

/* ---------- Cabecera pública ---------- */
.landing-header { position: fixed; top: 0; left: 0; z-index: 1000; width: 100%; padding: 8px 0; background-color: rgba(255, 255, 255, 0.97); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid rgba(22, 28, 45, 0.06); transition: box-shadow 0.25s, background-color 0.25s, padding 0.25s; }
.landing-header.is-scrolled { padding: 4px 0; background-color: rgba(255, 255, 255, 0.99); box-shadow: 0 6px 24px rgba(22, 28, 45, 0.08); }
.landing-header .lh-logo img { height: 50px; object-fit: contain; transition: height 0.25s, transform 0.25s; }
.landing-header.is-scrolled .lh-logo img { height: 42px; }
.landing-header .lh-logo:hover img { transform: scale(1.03); }
.lh-link, .lh-link:hover { color: #1d1d1b; }
.lh-link { position: relative; padding: 8px 2px; font-weight: 700; text-decoration: none; transition: color 0.2s; }
.lh-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; border-radius: 2px; background-color: var(--brand-primary, #fdc500); transform: scaleX(0); transform-origin: left center; transition: transform 0.25s var(--ui-ease, ease); }
.lh-link:hover::after, .lh-link.is-active::after { transform: scaleX(1); }
.lh-burger { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: 4px; border: 0; border-radius: 10px; background: transparent; color: #1d1d1b; cursor: pointer; transition: background-color 0.2s; }
.lh-burger:hover { background-color: rgba(22, 28, 45, 0.06); }
.lh-mobile { max-height: 0; overflow: hidden; visibility: hidden; background-color: #fff; border-top: 1px solid transparent; transition: max-height 0.3s var(--ui-ease, ease), visibility 0.3s, border-color 0.3s; }
.lh-mobile.is-open { max-height: 260px; visibility: visible; border-top-color: var(--color-border, #e5e7eb); }
.lh-mobile .menu-link, .lh-mobile .menu-link:hover { color: #1d1d1b; }
.lh-mobile .menu-link { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: background-color 0.2s, box-shadow 0.2s; }
.lh-mobile .menu-link:hover { background-color: #fffbe8; box-shadow: inset 3px 0 0 var(--brand-primary, #fdc500); }

/* ---------- Landing ---------- */
.lp-hero { position: relative; }
.lp-hero::before { content: ""; position: absolute; top: -140px; right: -90px; width: 540px; height: 540px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 197, 0, 0.2), rgba(253, 197, 0, 0) 68%); pointer-events: none; }
.lp-hero > .container { position: relative; }
.lp-hero .lp-hero-in { animation: ui-fade-up 0.7s var(--ui-ease, ease) backwards; }
.lp-hero .lp-hero-in--2 { animation-delay: 0.15s; }

/* Aparición al hacer scroll (la clase lp-ready la pone la landing al montarse; sin JS todo queda visible) */
.lp-reveal { transition: opacity 0.6s var(--ui-ease, ease), transform 0.6s var(--ui-ease, ease); }
.lp-reveal:nth-child(2) { transition-delay: 0.08s; }
.lp-reveal:nth-child(3) { transition-delay: 0.16s; }
.lp-ready .lp-reveal:not(.is-in) { opacity: 0; transform: translateY(20px); }

.lp-card { overflow: hidden; border: 1px solid var(--color-border, #e5e7eb); border-radius: 14px; background-color: #fff; box-shadow: var(--shadow-card, 0 1px 2px rgba(16, 24, 40, 0.05)); transition: transform 0.3s var(--ui-ease, ease), box-shadow 0.3s, border-color 0.3s; }
.lp-card:hover { transform: translateY(-6px); border-color: rgba(253, 197, 0, 0.9); box-shadow: 0 18px 40px rgba(22, 28, 45, 0.14); }
.lp-card__media { height: 200px; overflow: hidden; }
.lp-card__media img { transition: transform 0.6s var(--ui-ease, ease); }
.lp-card:hover .lp-card__media img { transform: scale(1.06); }
.lp-card__body { padding: 24px; }
.lp-card .lp-card__title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--color-text, #1d1d1b); }
.lp-card__num { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px; width: 30px; height: 30px; margin-left: 12px; border-radius: 8px; font-size: 13px; font-weight: 700; background-color: var(--brand-primary, #fdc500); color: var(--ui-navy, #161c2d); }

.lp-cta { position: relative; overflow: hidden; border-radius: 18px !important; box-shadow: 0 18px 40px rgba(22, 28, 45, 0.18); }
.lp-cta::before { content: ""; position: absolute; top: -90px; left: 50%; width: 460px; height: 460px; margin-left: -230px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 197, 0, 0.18), rgba(253, 197, 0, 0) 68%); pointer-events: none; }
.lp-cta > * { position: relative; }

/* ---------- Pie de página ---------- */
.footer { border-top: 3px solid var(--brand-primary, #fdc500); }
.footer .footer-head { position: relative; padding-bottom: 10px; letter-spacing: 0.02em; }
.footer .footer-head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; border-radius: 2px; background-color: var(--brand-primary, #fdc500); }
.footer .footer-list li a { display: inline-block; transition: transform 0.2s var(--ui-ease, ease), opacity 0.2s; }
.footer .footer-list li a:hover { transform: translateX(4px); }
.footer .logo-footer img { transition: transform 0.25s var(--ui-ease, ease); }
.footer .logo-footer:hover img { transform: scale(1.04); }

/* ---------- Fichas de producto (curso, libro, podcast, producto) ---------- */
.pd-aside > .row > .col-md-12:first-child > .card.border-0 { border-top: 4px solid var(--brand-primary, #fdc500) !important; box-shadow: 0 12px 28px rgba(22, 28, 45, 0.1) !important; }
.pd-aside > .row > .col-md-12:first-child .MuiButton-root { min-height: 46px; border-radius: 10px; }

/* ---------- Páginas de error ---------- */
@keyframes err-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.err-float { animation: err-float 5s ease-in-out infinite; }
.err-float + .display-3 { font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Páginas legales ---------- */
.legal-doc { max-width: 880px; }
.legal-doc h1 { letter-spacing: -0.02em; }
.legal-doc li { margin-bottom: 0.6rem; line-height: 1.75; }
.legal-doc h3, .legal-doc h6 { margin-top: 1.8rem; padding-left: 12px; border-left: 4px solid var(--brand-primary, #fdc500); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .lp-hero .lp-hero-in, .err-float { animation: none; }
    .lp-reveal { transition: none; }
    .lp-ready .lp-reveal:not(.is-in) { opacity: 1; transform: none; }
    .lp-card, .lp-card__media img, .landing-header, .landing-header .lh-logo img, .lh-link::after, .lh-mobile, .footer .footer-list li a { transition: none; }
    .lp-card:hover, .lp-card:hover .lp-card__media img, .footer .footer-list li a:hover { transform: none; }
}

/* ---------- Landing: hero oscuro, versión 2 ---------- */
@keyframes hv2-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(253, 197, 0, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(253, 197, 0, 0); } }

.hv2 { position: relative; overflow: hidden; padding: 140px 0 128px; color: #fff; background-color: #161c2d; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 44px), 0 100%); }
.hv2::before { content: ""; position: absolute; inset: 0; pointer-events: none; background:
    radial-gradient(720px 440px at 88% 8%, rgba(253, 197, 0, 0.22), rgba(253, 197, 0, 0) 62%),
    radial-gradient(640px 420px at 4% 96%, rgba(70, 92, 150, 0.28), rgba(70, 92, 150, 0) 62%),
    linear-gradient(135deg, #161c2d 0%, #1c2836 55%, #222d4a 100%); }
.hv2::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.3px); background-size: 24px 24px; -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 88%); mask-image: linear-gradient(to bottom, #000 0%, transparent 88%); }
.hv2 > .container { position: relative; z-index: 1; }

.hv2 .hv2-in { animation: ui-fade-up 0.75s var(--ui-ease, ease) backwards; animation-delay: calc(var(--i, 0) * 90ms); }

.hv2__pill { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px; padding: 6px 14px; border: 1px solid rgba(253, 197, 0, 0.35); border-radius: 999px; background-color: rgba(253, 197, 0, 0.1); color: var(--brand-primary, #fdc500); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.hv2__pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background-color: var(--brand-primary, #fdc500); animation: hv2-pulse 2.2s ease-out infinite; }
.hv2 .hv2__title { margin: 0 0 22px; color: #fff; font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; }
.hv2 .hv2__lead { max-width: 540px; margin: 0 0 32px; color: rgba(255, 255, 255, 0.78); font-size: 1.15rem; line-height: 1.65; }
.hv2__chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0 0; padding: 0; list-style: none; }
.hv2__chips li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; background-color: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.88); font-size: 13px; font-weight: 600; transition: background-color 0.2s, border-color 0.2s, transform 0.2s; }
.hv2__chips li:hover { border-color: rgba(253, 197, 0, 0.6); background-color: rgba(253, 197, 0, 0.1); transform: translateY(-2px); }
.hv2__chips i { color: var(--brand-primary, #fdc500); }

.hv2__visual { position: relative; max-width: 560px; margin-left: auto; }
.hv2__frame { position: relative; padding: 6px; border-radius: 24px; background: linear-gradient(135deg, rgba(253, 197, 0, 0.95), rgba(253, 197, 0, 0.12) 48%, rgba(255, 255, 255, 0.28)); box-shadow: 0 34px 70px rgba(0, 0, 0, 0.4); }
.hv2__frame img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center top; border-radius: 19px; }

@media (max-width: 991.98px) {
    .hv2 { padding: 120px 0 104px; }
    .hv2__visual { margin: 8px auto 0; }
}
@media (max-width: 575.98px) {
    .hv2 { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 0 100%); }
}
@media (prefers-reduced-motion: reduce) {
    .hv2 .hv2-in, .hv2__pill::before { animation: none; }
    .hv2__chips li { transition: none; }
    .hv2__chips li:hover { transform: none; }
}

/* Carta de afiliación: la portada (16:9) se ve casi completa; menos recorte y degradado de título más corto */
.aff-card .aff-card__media { flex: 0 0 63%; min-height: 0; aspect-ratio: 16 / 9; }
.aff-card .aff-card__media::after { height: 38%; }
.aff-card .aff-card__body { gap: 6px; padding: 10px 12px; }

/* Campus: con pocos productos (1 a 3), en escritorio cada carta es horizontal, mide ~60% y lleva mas informacion; en móvil, tarjeta normal */
.cp-list { display: flex; flex-direction: column; gap: 12px; }
.cp-card__meta { display: none; }
@media (min-width: 992px) {
    .cp-card--row { flex-direction: row; height: auto; width: 60%; min-width: 560px; max-width: 100%; }
    .cp-card--row .cp-card__media { flex: 0 0 240px; }
    .cp-card--row .cp-card__body { justify-content: center; gap: 10px; padding: 14px 18px; }
    .cp-card--row .cp-card__title { min-height: 0; font-size: 16px; }
    .cp-card--row .cp-card__foot { margin-top: 0; }
    .cp-card--row .cp-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; font-weight: 500; color: var(--color-text-muted, #595959); }
    .cp-card--row .cp-card__meta i { margin-right: 5px; }
    .cp-card__author { display: inline-flex; align-items: center; gap: 6px; color: var(--color-text, #1d1d1b); font-weight: 600; text-transform: capitalize; }
    .cp-card__author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--color-border-strong, #cfd4da); }
}
/* Campos MUI: el borde de foco ya lo dibuja el propio campo; se anula el halo global del input interno (se veia doble y tapaba la etiqueta) */
.MuiInputBase-root input:focus-visible,
.MuiInputBase-root textarea:focus-visible,
.MuiInputBase-root .MuiInputBase-input:focus-visible { box-shadow: none; outline: none; }
/* Campus: subtitulo / descripcion en la carta horizontal (escritorio) */
.cp-card__blurb { display: none; }
@media (min-width: 992px) {
    .cp-card--row .cp-card__blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: -4px 0 0; font-size: 13px; line-height: 1.45; color: var(--color-text-muted, #595959); }
}
/* Pago completado: icono animado con ondas y confeti, textos escalonados */
@keyframes pc-pop { 0% { transform: scale(0); opacity: 0; } 55% { transform: scale(1.18); opacity: 1; } 75% { transform: scale(0.94); } 100% { transform: scale(1); } }
@keyframes pc-ring { 0% { transform: scale(0.6); opacity: 0.55; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes pc-burst { 0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-74px) scale(0.4); opacity: 0; } }
.pc-success { position: relative; display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; }
.pc-success__icon { position: relative; z-index: 1; font-size: 72px; color: #398658; animation: pc-pop 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.pc-success__ring { position: absolute; inset: 12px; border: 3px solid #398658; border-radius: 50%; animation: pc-ring 1.4s ease-out 0.3s both; }
.pc-success__ring--2 { animation-delay: 0.65s; }
.pc-confetti { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; background: var(--brand-primary, #fdc500); animation: pc-burst 0.9s ease-out calc(0.35s + var(--d, 0ms)) both; }
.pc-confetti:nth-of-type(3n) { background: #398658; }
.pc-confetti:nth-of-type(3n+1) { background: #161c2d; border-radius: 50%; }
.pc-in { animation: ui-fade-up 0.6s var(--ui-ease, ease) backwards; animation-delay: calc(0.55s + var(--i, 0) * 90ms); }
@media (prefers-reduced-motion: reduce) {
    .pc-success__icon, .pc-success__ring, .pc-confetti, .pc-in { animation: none; }
    .pc-success__ring, .pc-confetti { display: none; }
}
/* Campus: con 2 productos, dos cartas horizontales lado a lado ocupando ~70% (escritorio ancho); la portada se ve casi completa */
@media (min-width: 1400px) {
    .cp-list--two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 70%; }
    .cp-list--two .cp-card--row { width: 100%; min-width: 0; }
    .cp-list--two .cp-card--row .cp-card__media { flex: 0 0 280px; aspect-ratio: 16 / 9; }
    .cp-list--two .cp-card--row .cp-card__body { padding: 12px 16px; gap: 8px; }
    .cp-list--two .cp-card--row .cp-card__title { font-size: 15px; }
}
/* Escritorio angosto: con 2 productos no caben horizontales sin recortar la portada; se usan cartas normales */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .cp-list--two { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; width: 100%; }
    .cp-list--two .cp-card--row { flex-direction: column; width: 100%; min-width: 0; }
    .cp-list--two .cp-card--row .cp-card__media { flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; }
    .cp-list--two .cp-card--row .cp-card__body { padding: 12px 14px 14px; }
    .cp-list--two .cp-card--row .cp-card__blurb, .cp-list--two .cp-card--row .cp-card__meta { display: none; }
}