/* ==========================================================================
   TEV Stream — UI premium estilo OTT (Netflix/Disney/Prime, marca propia)
   Eleva los componentes .nx-* del panel suscriptor. Se carga DESPUÉS de
   tev.css en el layout suscriptor, así que sobreescribe sus estilos.
   Responsive: rieles 2 (phone) / 3-4 (tablet) / 5-6 (desktop).
   ========================================================================== */

:root {
  --tev-red: #e10b17;        /* mismos tonos que /css/tv.css (diseño 2026-12) */
  --tev-red-2: #ff2a35;
  --st-bg: #10151e;
  --st-fg: #eef1f6;
  --st-dim: #98a2b3;
  --st-muted: #7d8799;
  --st-line: #2a3342;
  --st-tile: clamp(150px, 42vw, 300px);   /* ancho de tile responsive */
}

.nx-shell { background: var(--st-bg); color: var(--st-fg); min-height: 100vh; font-family: "Archivo", system-ui, sans-serif; }

/* ===== Top nav ===== */
.nx-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 26px;
  padding: 12px clamp(16px, 4vw, 52px);
  background: rgba(16,21,30,0.96); border-bottom: 1px solid var(--st-line); backdrop-filter: blur(6px);
  transition: background .25s ease, backdrop-filter .25s ease, padding .2s ease;
}
.nx-topbar.scrolled {
  background: rgba(16,21,30,0.92); backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--st-line);
}
.nx-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nx-logo-img { width: 36px; height: 36px; border-radius: 6px; background: url('/img/logo.jpg') center/cover; }
.nx-logo-text { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; color: #fff; }
.nx-nav { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
.nx-nav a {
  color: var(--st-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  position: relative; padding: 4px 0; transition: color .15s;
}
.nx-nav a:hover { color: #fff; text-decoration: none; }
.nx-nav a.active { color: #fff; font-weight: 700; }
.nx-nav a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--tev-red); border-radius: 2px; }
.nx-nav-logout { display: none; }      /* en desktop el logout vive en el menú de usuario */
.nx-nav-close { display: none; }       /* botón X del drawer, solo en móvil */
.nx-nav-auth { display: none; }        /* en desktop los botones auth viven en .nx-user */
.nx-user-login { color: #fff; font-size: .92rem; text-decoration: none; }
.nx-user-login:hover { color: #fff; text-decoration: none; opacity: .85; }
.nx-btn-ghost { background: transparent; border: 1px solid var(--st-line, #2a2a30); color: #fff; }
.nx-btn-ghost:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nx-nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 94; }
.nx-nav-overlay[hidden] { display: none; }
.nx-user { margin-left: auto; }
.nx-user-avatar {
  width: 34px; height: 34px; border-radius: 6px; background: var(--tev-red);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 0.95rem;
}
.nx-user-menu-btn { display: flex; align-items: center; gap: 7px; background: none; border: 0; cursor: pointer; }
.nx-user-menu { position: relative; }
.nx-user-menu-dd {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 230px; display: none;
  background: #1c2331; border: 1px solid var(--st-line); border-radius: 8px; padding: 8px 0;
  box-shadow: 0 18px 50px rgba(0,0,0,0.7); backdrop-filter: blur(10px);
}
.nx-user-menu.open .nx-user-menu-dd { display: block; }
.nx-user-menu-dd a, .nx-user-menu-dd button {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 10px 16px; color: #e5e5e5; font-size: 0.88rem; text-decoration: none;
}
.nx-user-menu-dd a:hover, .nx-user-menu-dd button:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nx-user-menu-dd .sep { height: 1px; background: var(--st-line); margin: 6px 0; }

/* ===== Hero cinematográfico ===== */
.nx-hero {
  position: relative; min-height: clamp(420px, 78vh, 760px); display: flex; align-items: flex-end;
  margin-top: 0; overflow: hidden;
}
.nx-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; transform: scale(1.02); }
.nx-hero-bg.no-cover { background: #222a38; }
.nx-hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(16,21,30,0.92) 0%, rgba(16,21,30,0.55) 38%, rgba(16,21,30,0.05) 70%),
    linear-gradient(0deg, var(--st-bg) 2%, rgba(16,21,30,0.4) 30%, transparent 70%);
}
.nx-hero-content { position: relative; z-index: 2; padding: 0 clamp(16px, 4vw, 52px) clamp(40px, 7vh, 80px); max-width: 720px; }
.nx-hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #ff5a5c; margin-bottom: 14px; }
.nx-hero-eyebrow .live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tev-red-2); animation: stPulse 1.4s ease-in-out infinite; }
@keyframes stPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(246,18,29,0.55); } 50% { box-shadow: 0 0 0 6px rgba(246,18,29,0); } }
.nx-hero-title { font-size: clamp(2rem, 6vw, 4.2rem); font-weight: 900; line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 14px; text-shadow: 0 2px 24px rgba(0,0,0,0.6); }
.nx-hero-meta { font-size: clamp(0.95rem, 1.6vw, 1.15rem); color: #d4d4d8; line-height: 1.5; max-width: 560px; margin-bottom: 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nx-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Botones ===== */
.nx-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 5px; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; border: 0; transition: transform .12s, background .15s, box-shadow .15s; }
.nx-btn:active { transform: scale(0.97); }
.nx-btn-play { background: var(--tev-red); color: #fff; }
.nx-btn-play:hover { background: var(--tev-red-2); text-decoration: none; color: #fff; }
.nx-btn-cta { background: var(--tev-red); color: #fff; }
.nx-btn-cta:hover { background: var(--tev-red-2); text-decoration: none; color: #fff; }

/* ===== Stats strip ===== */
.nx-stats { position: relative; z-index: 3; padding: 84px clamp(16px, 4vw, 52px) 0; }
.nx-hero + .nx-stats, .nx-content .nx-stats { padding-top: 24px; }
.nx-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.nx-stat { background: #1c2331; border: 1px solid var(--st-line); border-radius: 8px; padding: 16px 18px; backdrop-filter: blur(6px); }
.nx-stat.warn { border-color: rgba(229,9,20,0.4); }
.nx-stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--st-muted); font-weight: 700; }
.nx-stat-value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; letter-spacing: -0.01em; }
.nx-stat-sub { font-size: 0.8rem; color: var(--st-dim); margin-top: 4px; }

/* ===== Content / rows ===== */
.nx-content { padding: 30px clamp(16px, 4vw, 52px) 60px; display: flex; flex-direction: column; gap: 34px; }
.nx-row { margin: 0; }
.nx-row-title { font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-weight: 800; letter-spacing: -0.01em; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.nx-row-title .count { font-size: 0.7rem; font-weight: 700; color: var(--st-muted); background: rgba(255,255,255,0.06); border-radius: 20px; padding: 2px 9px; }
.section-h { display: flex; align-items: center; }
.nx-row-scroller {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 14px; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 40px), transparent 100%);
}
.nx-row-scroller::-webkit-scrollbar { display: none; }

/* ===== Tiles ===== */
.nx-tile { flex: 0 0 var(--st-tile); width: var(--st-tile); scroll-snap-align: start; text-decoration: none; color: inherit; transition: transform .18s ease, z-index 0s; }
.nx-tile:hover { text-decoration: none; }
.nx-tile-cover, .nx-tile-static { position: relative; }
.nx-tile-cover {
  aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background-size: cover; background-position: center;
  background-color: #232b3a; border: 1px solid var(--st-line);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.nx-tile-cover.no-cover { background: #232b3a url('/img/logo.jpg') center/40px no-repeat; }
.nx-tile:hover .nx-tile-cover { transform: translateY(-3px); border-color: #56627a; }
.nx-tile-badge {
  position: absolute; top: 8px; left: 8px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 3px; background: rgba(16,21,30,0.85); border: 1px solid rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(4px);
}
.nx-tile-badge.live { background: var(--tev-red); border-color: var(--tev-red); }
.nx-tile-badge.upcoming { background: #fff; color: #10151e; border-color: #fff; }
.nx-tile-info { padding: 10px; background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent); }
.nx-tile-info h4 { font-size: 0.9rem; font-weight: 700; margin: 0; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-tile-info .sub { font-size: 0.72rem; color: var(--st-dim); margin-top: 2px; }
.nx-tile-static { padding: 8px 2px 0; }
.nx-tile-static h4 { font-size: 0.88rem; font-weight: 600; margin: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-empty { padding: 26px; text-align: center; color: var(--st-muted); border: 1px dashed var(--st-line); border-radius: 12px; font-size: 0.9rem; }

/* ===== CTA + Planes ===== */
.nx-cta { margin-bottom: 14px; }
.nx-cta h3 { font-size: 1.5rem; font-weight: 800; }
.nx-cta p { color: var(--st-dim); }
.nx-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.nx-plan { position: relative; background: #1c2331; border: 1px solid var(--st-line); border-radius: 8px; padding: 26px 22px; text-align: center; }
.nx-plan.featured { border: 2px solid var(--tev-red); }
.badge-popular { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--tev-red); color: #fff; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; padding: 3px 10px; border-radius: 3px; }
.nx-plan h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.nx-plan .price { font-size: 2.4rem; font-weight: 900; letter-spacing: -0.02em; }
.nx-plan .price .cur { font-size: 1rem; font-weight: 700; color: var(--st-dim); vertical-align: super; }
.nx-plan .interval { color: var(--st-muted); font-size: 0.85rem; margin-bottom: 12px; }
.nx-plan .desc { color: var(--st-dim); font-size: 0.85rem; margin-bottom: 18px; min-height: 38px; }

/* ===== Páginas internas (account, 2fa, watch): contenedor que despeja el nav fijo ===== */
.nx-page { padding: 84px clamp(16px,4vw,52px) 64px; max-width: 1160px; margin: 0 auto; min-height: 72vh; }
.nx-page-bleed { padding: 60px 0 0; max-width: none; margin: 0; }   /* home / detalle: debajo de la barra fija (60px) */
.nx-page h1 { font-size: clamp(1.4rem,3vw,2rem); font-weight: 800; letter-spacing: -0.02em; }
.nx-page h2 { font-size: 1.2rem; font-weight: 800; }
.nx-page h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.nx-page .muted { color: var(--st-dim); }
.nx-page .grid { display: grid; gap: 16px; }
.nx-page .grid-2 { grid-template-columns: repeat(2,1fr); }
@media (max-width: 760px){ .nx-page .grid-2 { grid-template-columns: 1fr; } }
.nx-page .card { background: #1c2331; border: 1px solid var(--st-line); border-radius: 8px; padding: 22px; margin-bottom: 16px; }
.nx-page .field { margin-bottom: 14px; }
.nx-page .field label { display:block; font-size:.8rem; color: var(--st-dim); font-weight:600; margin-bottom:6px; }
.nx-page input[type=text], .nx-page input[type=email], .nx-page input[type=password],
.nx-page input[type=tel], .nx-page input:not([type]), .nx-page select, .nx-page textarea {
  width:100%; padding:10px 12px; background:#0f141c; color:#fff; border:1px solid var(--st-line);
  border-radius:6px; font-size:.92rem; font-family:inherit;
}
.nx-page input:focus, .nx-page select:focus, .nx-page textarea:focus { outline:none; border-color:var(--tev-red); box-shadow:0 0 0 3px rgba(229,9,20,.25); }
.nx-page .btn { display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border-radius:5px; background:var(--tev-red); color:#fff; border:0; font-weight:700; font-size:.92rem; cursor:pointer; text-decoration:none; }
.nx-page .btn:hover { background:var(--tev-red-2); color:#fff; text-decoration:none; }
.nx-page .btn-ghost { background:transparent; border:1px solid var(--st-line); color:#fff; }
.nx-page .btn-ghost:hover { background:rgba(255,255,255,.06); }
.nx-page .btn-sm { padding:7px 14px; font-size:.85rem; }
.nx-page .btn-danger { background:#b00610; }
.nx-page table { width:100%; border-collapse:collapse; font-size:.9rem; }
.nx-page th { text-align:left; padding:10px 12px; font-size:.68rem; text-transform:uppercase; letter-spacing:.06em; color:var(--st-muted); border-bottom:1px solid var(--st-line); }
.nx-page td { padding:11px 12px; border-bottom:1px solid var(--st-line); }
.nx-page .pill { display:inline-flex; align-items:center; padding:2px 10px; border-radius:20px; font-size:.72rem; font-weight:700; background:rgba(255,255,255,.06); color:var(--st-dim); text-transform:uppercase; }
.nx-page .pill-ok { color:#46d369; background:rgba(46,160,67,.12); }
.nx-page .pill-warn { color:#f5c518; background:rgba(245,197,24,.12); }
.nx-page .pill-live { color:#ff5a5c; background:rgba(229,9,20,.14); }
.nx-page code { background:#0f141c; border:1px solid var(--st-line); border-radius:6px; padding:1px 6px; font-size:.82rem; }
.nx-page .player-shell, .nx-page video { width:100%; border-radius:8px; overflow:hidden; background:#000; }

/* ===== Footer ===== */
.nx-footer { padding: 40px clamp(16px,4vw,52px); text-align: center; color: var(--st-muted); font-size: 0.78rem; border-top: 1px solid var(--st-line); margin-top: 20px; }

/* ===== Mobile ===== */
.nx-burger { display: none; background: none; border: 0; color: #fff; cursor: pointer; margin-left: auto; }
@media (max-width: 860px) {
  :root { --st-tile: clamp(140px, 44vw, 220px); }
  .nx-nav {
    position: fixed; inset: 0 0 0 auto; width: 76%; max-width: 320px; flex-direction: column; align-items: flex-start;
    gap: 4px; padding: 84px 22px 22px; background: rgba(16,21,30,0.98); backdrop-filter: blur(14px);
    border-left: 1px solid var(--st-line); transform: translateX(100%); transition: transform .22s ease; z-index: 96;
  }
  .nx-nav.open { transform: translateX(0); }
  .nx-nav a { font-size: 1.05rem; padding: 12px 0; width: 100%; }
  .nx-nav a.active::after { display: none; }
  .nx-nav-logout { display: block; margin-top: 12px; border-top: 1px solid var(--st-line); padding-top: 16px; width: 100%; }
  .nx-nav-logout button { background: none; border: 1px solid var(--st-line); color: #fff; padding: 10px 16px; border-radius: 8px; width: 100%; cursor: pointer; }
  .nx-nav-close { display: block; position: absolute; top: 18px; right: 18px; background: none; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
  .nx-nav-auth { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 18px; border-top: 1px solid var(--st-line, #2a2a30); padding-top: 18px; }
  .nx-nav-auth .nx-btn { width: 100%; text-align: center; justify-content: center; }
  .nx-burger { display: inline-flex; order: 3; }
  /* En el público .nx-user es el bloque de botones desktop: se oculta en móvil.
     En el panel (.nx-shell) .nx-user es el menú de avatar y debe seguir visible. */
  .nx-user { display: none; }
  .nx-shell .nx-user { display: flex; order: 2; margin-left: auto; }
  .nx-hero-content { max-width: 100%; }
  .nx-stats { margin-top: 16px; }
}
@media (min-width: 1500px) { :root { --st-tile: 300px; } }
