/* Diseño TEV 2026-12 (estilo Triller TV): home pública, panel del suscriptor y páginas públicas. */
/* Archivo (licencia OFL), variable en ancho y peso, alojada acá: la CSP no permite Google Fonts */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-var-latin.woff2") format("woff2"); font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; }
html, body { background: #10151e; color: #eef1f6; font-family: "Archivo", system-ui, sans-serif; font-size: 15px; }
body::before { display: none; }
.tv { --bg: #10151e; --bg2: #171d29; --card: #1c2331; --line: #2a3342; --text: #eef1f6; --muted: #98a2b3; --red: #e10b17; --red-hi: #ff2a35; --wrap: 1240px; }
.tv a { color: inherit; text-decoration: none; }
.tv { position: relative; isolation: isolate; }
.tv-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.tv-bg::before, .tv-bg::after { content: ""; position: absolute; background: url("/img/halftone.svg") center/contain no-repeat; }
/* puntos en semitono (blanco tenue): grande a la derecha, chico y girado a la izquierda */
.tv-bg::before { width: min(78vw, 980px); aspect-ratio: 1; right: max(-22vw, -280px); top: 50%; transform: translateY(-42%); opacity: .13; }
.tv-bg::after { width: min(48vw, 560px); aspect-ratio: 1; left: max(-16vw, -200px); top: -6%; transform: rotate(180deg); opacity: .08; }
@media (max-width: 820px) { .tv-bg::before { width: 130vw; right: -55vw; } .tv-bg::after { width: 90vw; left: -40vw; } }
.tv-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.tv a:focus-visible, .tv button:focus-visible { outline: 3px solid var(--red-hi); outline-offset: 3px; }

/* Barra superior */
.tv-top { background: rgba(16,21,30,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(6px); }
.tv-top .tv-wrap { display: flex; align-items: center; gap: 26px; height: 56px; }
.tv-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: .98rem; }
.tv-logo img { width: 30px; height: 30px; border-radius: 6px; }
.tv-nav { display: flex; gap: 20px; font-size: .88rem; font-weight: 600; }
.tv-nav a { color: var(--muted); min-height: 0; padding: 6px 0; }
.tv-nav a:hover { color: var(--text); }
.tv-acts { margin-left: auto; display: flex; gap: 8px; }
.tv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; border-radius: 5px; font-weight: 700; font-size: .86rem; background: var(--red); color: #fff !important; border: 2px solid var(--red); min-height: 0; white-space: nowrap; cursor: pointer; }
.tv-btn:hover { background: var(--red-hi); border-color: var(--red-hi); }
.tv-btn.line { background: transparent; border-color: #4a5466; }
.tv-btn.line:hover { border-color: var(--text); background: rgba(255,255,255,.06); }
.tv-btn.big { padding: 10px 18px; font-size: .92rem; }

/* Franja de programación */
.tv-strip { background: var(--bg2); border-bottom: 1px solid var(--line); }
.tv-strip .tv-wrap { display: flex; overflow-x: auto; scrollbar-width: none; }
.tv-strip .tv-wrap::-webkit-scrollbar { display: none; }
.tv-strip a { flex: none; padding: 8px 18px 8px 0; margin-right: 18px; border-right: 1px solid var(--line); min-width: 190px; max-width: 260px; }
.tv-strip a:last-child { border-right: 0; }
.tv-strip .w { font-size: .74rem; color: var(--muted); display: flex; align-items: center; gap: 6px; min-height: 18px; }
.tv-strip .n { font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-strip a:hover .n { color: var(--red-hi); }

/* Etiquetas de estado */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 3px; font-size: .68rem; font-weight: 800; letter-spacing: .02em; line-height: 1.35; }
.tag.live { background: var(--red); color: #fff; }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: tvBlink 1.2s steps(2, start) infinite; }
.tag.soon { background: #fff; color: #10151e; }
.tag.wait { background: #f0922b; color: #fff; }
.tag.wait::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: tvBlink 1.2s steps(2, start) infinite; }
.tag.vod { background: rgba(16,21,30,.85); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.tag.top { background: #f5b301; color: #10151e; }
@keyframes tvBlink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .tag.live::before, .tag.wait::before { animation: none; } }

/* Destacado (carrusel) — slides apilados para que todas las portadas carguen de entrada */
.tv-hero { position: relative; display: grid; background: var(--bg); overflow: hidden; border-bottom: 1px solid var(--line); }
.tv-slide { grid-area: 1 / 1; position: relative; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
.tv-slide.on { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .tv-slide { transition: none; } }
/* En vivo con señal: resplandor rojo a la izquierda, línea roja abajo y etiqueta grande que late. Sin señal: etiqueta naranja. */
.tv-slide.is-live { background: radial-gradient(ellipse 60% 120% at 0% 50%, rgba(225,11,23,.28), transparent 70%), var(--bg); box-shadow: inset 0 -3px 0 var(--red); }
.tv-hero-txt .tag.live, .tv-hero-txt .tag.wait { font-size: .82rem; padding: 5px 11px; border-radius: 4px; }
.tv-hero-txt .tag.live { animation: tvGlow 1.8s ease-in-out infinite; }
.tv-hero-txt .tag.live::before, .tv-hero-txt .tag.wait::before { width: 8px; height: 8px; }
@keyframes tvGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(225,11,23,.7); } 50% { box-shadow: 0 0 0 8px rgba(225,11,23,0), 0 0 22px 4px rgba(225,11,23,.55); } }
@media (prefers-reduced-motion: reduce) { .tv-hero-txt .tag.live { animation: none; } }
.tv-hero-img { position: absolute; inset: 0 0 0 40%; background: #222a38 center/cover no-repeat; clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%); }
.tv-hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16,21,30,.5), transparent 30%); }
.tv-hero-img.empty { display: flex; align-items: center; justify-content: center; }
.tv-hero-img.empty img { width: 90px; height: 90px; border-radius: 14px; }
.tv-hero-img.empty img.largo { width: min(70%, 440px); height: auto; border-radius: 0; }
.tv-hero .tv-wrap { position: relative; min-height: 340px; display: flex; align-items: center; }
.tv-hero-txt { max-width: 460px; padding: 34px 0 40px; }
.tv-hero h1 { font-stretch: 74%; font-weight: 900; font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1; margin: 12px 0 10px; }
.tv-hero .desc { color: #c3cad6; font-size: .95rem; line-height: 1.45; margin: -2px 0 12px; max-width: 44ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tv-hero .when { font-stretch: 82%; font-weight: 800; font-size: 1.08rem; }
.tv-hero .when span { color: var(--red-hi); }
.tv-hero .by { color: var(--muted); margin-top: 3px; font-size: .9rem; }
.tv-count { display: flex; gap: 8px; margin: 16px 0 2px; }
.tv-count div { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; min-width: 52px; text-align: center; }
.tv-count b { display: block; font-stretch: 78%; font-weight: 900; font-size: 1.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-count small { color: var(--muted); font-size: .68rem; }
.tv-hero .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tv-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; display: flex; gap: 7px; z-index: 5; }
.tv-dots button { width: 24px; height: 5px; min-height: 0; padding: 0; border: 0; border-radius: 3px; background: rgba(255,255,255,.3); cursor: pointer; }
.tv-dots button.on { background: var(--red); }

/* Filas deslizables (en vivo, más visto, videoteca y, más adelante, una por categoría) */
.tv-sec { padding: 30px 0 4px; }
.tv-sec-h { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 12px; }
.tv-sec-h h2 { font-stretch: 80%; font-weight: 900; font-size: 1.3rem; line-height: 1.1; padding-left: 10px; border-left: 4px solid var(--red); }
.tv-sec-h .sub { color: var(--muted); font-size: .84rem; }
.tv-arrows { margin-left: auto; display: flex; gap: 6px; }
.tv-arrows button { width: 30px; height: 30px; min-height: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tv-arrows button:hover { border-color: var(--text); }
.tv-arrows button:disabled { opacity: .35; cursor: default; }
.tv-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 14px) / 5); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 4px; }
.tv-row::-webkit-scrollbar { display: none; }
.tv-card { display: block; scroll-snap-align: start; background: var(--card); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); transition: border-color .15s; }
.tv-card:hover { border-color: #56627a; }
.tv-card .img { position: relative; aspect-ratio: 16/9; background: #232b3a center/cover no-repeat; }
.tv-card .img.empty { display: flex; align-items: center; justify-content: center; }
.tv-card .img.empty img { width: 40px; height: 40px; border-radius: 8px; opacity: .85; }
.tv-card .img .tag { position: absolute; left: 7px; bottom: 7px; }
.tv-card .rank { position: absolute; top: 6px; left: 7px; font-stretch: 70%; font-weight: 900; font-size: 1.6rem; line-height: 1; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.tv-card .body { padding: 9px 10px 11px; }
.tv-card .dt { font-stretch: 82%; font-weight: 800; font-size: .86rem; }
.tv-card .dt span { color: var(--muted); font-weight: 600; }
.tv-card h3 { font-size: .86rem; font-weight: 700; line-height: 1.3; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-card .by { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.tv-card:hover h3 { color: var(--red-hi); }

/* Planes */
.tv-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 720px; }
.tv-plan { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; position: relative; }
.tv-plan.best { border: 2px solid var(--red); }
.tv-plan > .tag { position: absolute; top: -10px; left: 18px; }
.tv-plan > .tag::before { display: none; }
.tv-plan h3 { font-size: 1rem; font-weight: 700; }
.tv-plan .price { font-stretch: 78%; font-weight: 900; font-size: 2.4rem; line-height: 1; margin: 8px 0 2px; }
.tv-plan .price small { font-size: .9rem; font-weight: 700; color: var(--muted); margin-right: 5px; }
.tv-plan .per { color: var(--muted); font-size: .86rem; }
.tv-plan .desc { color: var(--muted); font-size: .86rem; margin: 10px 0 16px; flex: 1; }

/* Cómo funciona */
.tv-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.tv-steps li { counter-increment: s; background: var(--bg2); border-radius: 8px; padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.tv-steps li::before { content: counter(s); grid-row: span 2; font-stretch: 74%; font-weight: 900; font-size: 2.1rem; line-height: .9; color: var(--red); }
.tv-steps h3 { font-size: .95rem; font-weight: 700; }
.tv-steps p { color: var(--muted); font-size: .84rem; }

/* Pie */
.tv-foot { margin-top: 50px; background: #0b0f16; border-top: 1px solid var(--line); padding: 24px 0 30px; font-size: .84rem; color: var(--muted); }
.tv-foot .tv-wrap { display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: space-between; align-items: flex-start; }
.tv-foot nav { display: flex; gap: 20px; }
.tv-foot nav a { min-height: 0; }
.tv-foot nav a:hover { color: var(--text); }
.tv-sign { font-size: .75rem; letter-spacing: .02em; color: rgba(255,255,255,.4); line-height: 1.6; }

/* Banner instalar app (Android) */
.tev-install-banner { position: sticky; top: 0; z-index: 200; display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 9px 16px; background: #e10b17; color: #fff; font-size: .88rem; }
.tev-install-text { font-weight: 600; }
.tev-install-btn { background: #fff; color: #e10b17; text-decoration: none; font-weight: 700; padding: 5px 12px; border-radius: 5px; white-space: nowrap; min-height: 0; }
.tev-install-close { background: none; border: 0; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; min-height: 0; }

@media (max-width: 1100px) { .tv-row { grid-auto-columns: calc((100% - 3 * 14px) / 4); } }
@media (max-width: 820px) {
  .tv-nav { display: none; }
  .tv-hero-img { position: relative; inset: auto; display: block; aspect-ratio: 16/9; clip-path: none; }
  .tv-hero-img::after { background: linear-gradient(0deg, var(--bg), transparent 40%); }
  .tv-hero .tv-wrap { min-height: 0; }
  .tv-hero-txt { padding: 2px 0 40px; }
  .tv-row { grid-auto-columns: calc((100% - 2 * 12px) / 2.6); gap: 12px; }
  .tv-arrows { display: none; }
  .tv-steps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tv-wrap { padding: 0 14px; }
  .tv-top .tv-wrap { gap: 10px; }
  .tv-acts { gap: 6px; }
  .tv-acts .tv-btn { padding: 6px 10px; font-size: .8rem; }
  .tv-row { grid-auto-columns: 62%; }
}

/* Pantallas muy angostas: solo el ícono del logo, así entran Ingresar y Registrarme */
@media (max-width: 400px) { .tv-logo { font-size: 0; gap: 0; } }

/* Barra de la cuenta del suscriptor (inicio del panel) */
.tv-acct { background: var(--bg2); border-bottom: 1px solid var(--line); font-size: .86rem; }
.tv-acct .tv-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.tv-acct .st { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.tv-acct .st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; }
.tv-acct.grace .st::before { background: #f0922b; }
.tv-acct.none .st::before { background: var(--red); }
.tv-acct .muted { color: var(--muted); }
.tv-acct .go { margin-left: auto; }
.tv-acct .go a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.tv-plan form { margin: 0; }
.tv-plan form .tv-btn { width: 100%; }

/* ===== Ficha del evento (pública y del panel) ===== */
.tv-ev .tv-hero-txt { max-width: 520px; }
.tv-ev .desc { -webkit-line-clamp: 8; max-width: 58ch; }
.tv-back { display: inline-block; color: var(--muted); font-size: .86rem; margin-bottom: 12px; }
.tv-back:hover { color: var(--text); }
.tv-share { display: flex; gap: 8px; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.tv-share > span { color: var(--muted); font-size: .82rem; }
.tv-share .ev-share { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 0; border-radius: 5px; border: 1px solid var(--line); background: var(--card); color: #fff; cursor: pointer; }
.tv-share .ev-share:hover { border-color: var(--text); }
.tv-share .ok { color: #2fbf71; font-size: .8rem; }
.tv-hero-txt .tag.vod, .tv-hero-txt .tag.soon { font-size: .82rem; padding: 5px 11px; border-radius: 4px; }

/* ===== Reproductor ===== */
.tv-watch-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tv-watch-head .t { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tv-watch-head h1 { font-stretch: 78%; font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.05; margin: 0; }
.tv-watch-desc { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.tv-watch-desc h2 { font-size: 1rem; font-weight: 700; margin: 0 0 6px; }
.tv-watch-desc p { color: #c3cad6; white-space: pre-line; margin: 0; }

/* ===== Pantallas de acceso (ingresar, registrarse, verificar, recuperar) =====
   Reutilizan las clases de tev.css; acá solo se cambia la paleta y se suma el fondo de puntos. */
.auth-shell { --bg-card: #1c2331; --bg-elevated: #0f141c; --border: #2a3342; --border-strong: #3a4558; --brand: #e10b17; --brand-bright: #ff2a35;
  --brand-glow: rgba(225,11,23,.25); --text: #eef1f6; --text-muted: #98a2b3; --danger: #ff5a5c; position: relative; isolation: isolate; overflow: hidden; }
.auth-shell::before { content: ""; position: absolute; z-index: -1; width: min(95vw, 900px); aspect-ratio: 1; right: -18%; top: 50%; transform: translateY(-50%);
  background: url("/img/halftone.svg") center/contain no-repeat; opacity: .12; pointer-events: none; }
.auth-card { border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-logo { width: 64px; height: 64px; border-radius: 10px; filter: none; }
.auth-title { font-stretch: 78%; font-weight: 900; font-size: 1.8rem; }
.auth-shell .btn { border-radius: 5px; font-weight: 700; }
.auth-shell input, .auth-shell select, .auth-shell textarea { border-radius: 6px; }
