/* ==========================================================================
   NixCast web app
   Palette sampled from tv.nixsat.com; every value is overridable from
   Admin → Settings → Front-end colours, which writes the vars in <head>.
   ========================================================================== */

:root{
  --bg-top:#022B48;
  --bg-bottom:#024050;
  --surface:#1C445B;
  --accent:#2F2381;
  --text:#FAFAFA;
  --muted:#C3CED4;

  --rail-w:72px;
  --watch-chrome:150px;   /* room kept below the player for the title row */
  --glass:rgba(255,255,255,.055);
  --glass-line:rgba(255,255,255,.13);
  --card-r:4px;
  --shell-pad:40px;
  --live:#E23A3A;
  --ease:cubic-bezier(.22,.61,.36,1);
}

*{margin:0;padding:0;box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,var(--bg-top) 0%,var(--bg-bottom) 100%);
  background-attachment:fixed;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button{font-family:inherit;color:inherit}
:focus{outline:none}
:focus-visible{outline:2px solid #fff;outline-offset:3px;border-radius:4px}

/* ---------- layout ---------- */
.app{display:flex;min-height:100vh}
.stage{flex:1;min-width:0;padding:0 var(--shell-pad) 80px calc(var(--rail-w) + var(--shell-pad))}
.stage.plain{padding-top:40px}

/* ---------- left icon rail (matches tv.nixsat.com) ---------- */
.rail{
  position:fixed;top:0;left:0;bottom:0;width:var(--rail-w);z-index:40;
  background:rgba(255,255,255,.055);
  display:flex;flex-direction:column;align-items:center;
  padding:22px 0;gap:0;
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.rail-logo{width:40px;height:40px;display:grid;place-items:center;margin-bottom:auto}
.rail-logo img{width:36px;height:36px;object-fit:contain}
.rail-logo .mark{
  width:34px;height:34px;border-radius:8px;background:var(--accent);
  display:grid;place-items:center;font-weight:800;font-size:15px;color:#fff;
}
.rail-nav{display:flex;flex-direction:column;align-items:center;width:100%;margin:auto 0}
.rail-btn{
  width:100%;height:72px;display:grid;place-items:center;background:none;border:none;
  cursor:pointer;color:var(--text);opacity:.85;transition:background .18s var(--ease),opacity .18s;
}
.rail-btn:hover{opacity:1;background:rgba(255,255,255,.06)}
.rail-btn.on{background:rgba(255,255,255,.1);opacity:1}
.rail-btn.on::before{content:'';position:absolute;left:0;width:3px;height:38px;background:#fff;border-radius:0 3px 3px 0}
.rail-btn{position:relative}
.rail-foot{margin-top:auto;display:flex;flex-direction:column;align-items:center;gap:6px;width:100%}
.rail-avatar{
  width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;
  display:grid;place-items:center;font-size:13px;font-weight:700;
}

/* ---------- hero carousel ---------- */
.hero{position:relative;margin:0 calc(var(--shell-pad) * -1) 8px;height:min(62vh,560px);min-height:380px;overflow:hidden}
.hero-slide{
  position:absolute;inset:0;opacity:0;transition:opacity .7s var(--ease);
  background-size:cover;background-position:center 28%;
  display:flex;align-items:flex-end;
}
.hero-slide.on{opacity:1}
.hero-slide::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(2,34,52,.94) 0%,rgba(2,34,52,.72) 42%,rgba(2,43,72,.15) 78%),
             linear-gradient(0deg,var(--bg-top) 2%,rgba(2,43,72,0) 46%);
}
.hero-body{position:relative;z-index:2;padding:0 var(--shell-pad) 58px calc(var(--rail-w) + var(--shell-pad));max-width:min(720px,72%)}
.hero-eyebrow{
  display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:14px;
}
.hero-eyebrow .live-dot{width:7px;height:7px;border-radius:50%;background:var(--live);animation:pulse 1.6s infinite}
.hero h1{font-size:clamp(30px,4.4vw,54px);font-weight:800;line-height:1.04;letter-spacing:-.02em;margin-bottom:14px}
.hero p{font-size:15.5px;line-height:1.6;color:var(--muted);max-width:56ch;margin-bottom:24px}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap}
.hero-dots{position:absolute;right:var(--shell-pad);bottom:30px;z-index:3;display:flex;gap:7px}
.hero-dots button{width:26px;height:3px;border:none;border-radius:2px;background:rgba(255,255,255,.32);cursor:pointer;padding:0}
.hero-dots button.on{background:#fff}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;gap:9px;padding:12px 24px;border-radius:6px;
  border:none;cursor:pointer;font-size:14.5px;font-weight:700;background:#fff;color:#0B1B2A;
  transition:transform .14s var(--ease),filter .14s;
}
.btn:hover{transform:translateY(-1px);filter:brightness(.94)}
.btn-accent{background:var(--accent);color:#fff}
.btn-accent:hover{filter:brightness(1.14)}
.btn-ghost{background:rgba(255,255,255,.14);color:var(--text);backdrop-filter:blur(4px)}
.btn-ghost:hover{background:rgba(255,255,255,.22);filter:none}
.btn-block{width:100%;justify-content:center}
.btn svg{flex-shrink:0}

/* ---------- section + rails ---------- */
.section{margin:44px 0 0}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.section-title{
  display:flex;align-items:center;gap:14px;font-size:clamp(20px,2.2vw,27px);
  font-weight:700;letter-spacing:-.01em;
}
.section-title::before{content:'';width:4px;height:1.05em;background:#fff;border-radius:2px;flex-shrink:0}
.section-more{font-size:13px;color:var(--muted);font-weight:600}
.section-more:hover{color:#fff}

.rail-arrows{display:flex;gap:10px}
.arrow{
  width:38px;height:38px;border-radius:50%;border:none;cursor:pointer;
  background:var(--accent);color:#fff;display:grid;place-items:center;
  transition:filter .16s,opacity .16s;
}
.arrow:hover{filter:brightness(1.25)}
.arrow[disabled]{opacity:.35;cursor:default;filter:none}

.strip{
  display:flex;gap:18px;overflow-x:auto;scroll-behavior:smooth;
  padding:6px 0 10px;margin:-6px 0 -10px;
  scrollbar-width:none;-ms-overflow-style:none;
}
.strip::-webkit-scrollbar{display:none}

/* ---------- content card + the "glassy glow" hover ---------- */
.card{
  flex:0 0 var(--card-w,224px);width:var(--card-w,224px);
  padding:6px 6px 0;margin:-6px -6px 0;border-radius:6px;
  border:1px solid transparent;background:transparent;
  transition:background .2s var(--ease),border-color .2s var(--ease),box-shadow .2s var(--ease);
  position:relative;
}
.card:hover,.card:focus-within,.card.tv-focus{
  background:var(--glass);
  border-color:var(--glass-line);
  box-shadow:0 0 0 1px rgba(255,255,255,.05), 0 14px 34px -18px rgba(0,0,0,.85),
             inset 0 1px 0 rgba(255,255,255,.09);
}
.card-art{
  position:relative;aspect-ratio:16/9;border-radius:var(--card-r);overflow:hidden;
  background:#0A2C42 center/cover no-repeat;
  box-shadow:0 6px 20px -12px rgba(0,0,0,.9);
}
.card-art img{width:100%;height:100%;object-fit:cover;transition:opacity .3s}
.card-art .fallback{
  position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:14px;
  font-size:14px;font-weight:700;letter-spacing:.04em;color:rgba(255,255,255,.72);
  background:linear-gradient(140deg,#0C3350,#06405A);
}
.card-art video{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  opacity:0;transition:opacity .35s;pointer-events:none;
}
.card-art video.playing{opacity:1}
.card-badges{position:absolute;top:8px;left:8px;display:flex;gap:6px;z-index:2}
.tag{
  font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;
  padding:3px 7px;border-radius:3px;background:rgba(0,0,0,.62);backdrop-filter:blur(4px);
}
.tag.live{background:var(--live);display:inline-flex;align-items:center;gap:5px}
.tag.live i{width:5px;height:5px;border-radius:50%;background:#fff;animation:pulse 1.6s infinite}
.tag.free{background:rgba(255,255,255,.9);color:#0B1B2A}
.card-dur{
  position:absolute;bottom:7px;right:8px;font-size:11px;font-weight:600;
  padding:2px 6px;border-radius:3px;background:rgba(0,0,0,.7);z-index:2;
}
.card-play{
  position:absolute;inset:0;display:grid;place-items:center;opacity:0;z-index:2;
  background:linear-gradient(0deg,rgba(2,26,44,.55),rgba(2,26,44,.1));
  transition:opacity .2s var(--ease);
}
.card:hover .card-play,.card.tv-focus .card-play{opacity:1}
.card-play span{
  width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.92);color:#0B1B2A;
  display:grid;place-items:center;
}
.card-label{padding:11px 4px 13px;font-size:14px;font-weight:600;line-height:1.35}
.card-label small{display:block;font-size:12px;font-weight:500;color:var(--muted);margin-top:3px}

/* ---------- grid pages ---------- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:22px 18px;margin-top:8px}
.grid .card{flex:none;width:auto}

/* ---------- detail pages ---------- */
.detail{position:relative;margin:0 calc(var(--shell-pad) * -1) 0;padding:0 0 30px}
.detail-art{
  position:absolute;inset:0;height:min(60vh,520px);background-size:cover;background-position:center 25%;
}
.detail-art::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(2,34,52,.95),rgba(2,34,52,.6) 55%,rgba(2,43,72,.2)),
             linear-gradient(0deg,var(--bg-top) 4%,rgba(2,43,72,0) 60%);
}
.detail-body{
  position:relative;z-index:2;padding:min(16vh,120px) var(--shell-pad) 0 calc(var(--rail-w) + var(--shell-pad));
  max-width:min(760px,78%);
}
.detail-body h1{font-size:clamp(28px,3.6vw,44px);font-weight:800;letter-spacing:-.02em;margin-bottom:12px}
.meta-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--muted);margin-bottom:18px}
.meta-row .sep{opacity:.4}
.detail-body p.lead{font-size:15.5px;line-height:1.65;color:var(--muted);margin-bottom:24px;max-width:60ch}
.detail-actions{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:8px}

.panel{
  background:var(--glass);border:1px solid var(--glass-line);border-radius:10px;padding:22px 24px;
}
.panel h3{font-size:15px;font-weight:700;margin-bottom:14px}
.epg-row{display:flex;gap:16px;padding:11px 0;border-bottom:1px solid rgba(255,255,255,.08);font-size:13.5px}
.epg-row:last-child{border-bottom:none}
.epg-row time{color:var(--muted);flex:0 0 108px;font-variant-numeric:tabular-nums}
.epg-row .now{color:var(--live);font-weight:700}

/* ---------- watch page ----------
   The stage already reserves room for the fixed rail on its left. The player
   only cancels the page's own horizontal padding, so it starts flush against
   the rail rather than sliding underneath it. Pulling the full rail width, as
   this once did, hid the first 72px of every video behind the sidebar. */
.watch-wrap{
  padding:0;
  margin:0 calc(var(--shell-pad) * -1);
  background:#000;
}
.player-shell{
  position:relative;
  width:100%;
  /* Keep the whole player on screen. A 16:9 box across a wide monitor is
     taller than the viewport, which pushes the title and everything under it
     below the fold, so cap the width by the height that is actually free. */
  max-width:calc((100vh - var(--watch-chrome)) * 16 / 9);
  margin:0 auto;
  background:#000;
}
.watch-info{padding:26px 0 0}
.watch-info h1{font-size:clamp(21px,2.4vw,30px);font-weight:800;margin-bottom:8px}

.paywall{
  max-width:520px;margin:0 auto;background:var(--glass);border:1px solid var(--glass-line);
  border-radius:12px;padding:30px;text-align:center;
}
.paywall h2{font-size:20px;font-weight:800;margin-bottom:10px}
.paywall p{font-size:14.5px;color:var(--muted);line-height:1.6;margin-bottom:22px}
.paywall .btn{margin:0 5px 8px}

/* ---------- forms / auth ---------- */
.auth-wrap{max-width:420px;margin:min(9vh,90px) auto 60px;padding:0 20px}
.auth-card{background:var(--glass);border:1px solid var(--glass-line);border-radius:12px;padding:32px}
.auth-card h1{font-size:24px;font-weight:800;margin-bottom:6px}
.auth-card .sub{font-size:14px;color:var(--muted);margin-bottom:24px;line-height:1.55}
label.field{display:block;font-size:12.5px;font-weight:600;color:var(--muted);margin-bottom:7px}
input.text,select.text{
  width:100%;padding:12px 14px;border-radius:7px;border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.22);color:var(--text);font-size:14.5px;margin-bottom:16px;font-family:inherit;
}
input.text::placeholder{color:rgba(255,255,255,.38)}
input.text:focus{border-color:rgba(255,255,255,.45);background:rgba(0,0,0,.3)}
.sso{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}
.sso a{
  display:flex;align-items:center;justify-content:center;gap:10px;padding:12px;border-radius:7px;
  background:#fff;color:#1B1B1B;font-size:14px;font-weight:600;
}
.sso a.fb{background:#1877F2;color:#fff}
.sso a:hover{filter:brightness(.95)}
.divider{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin:4px 0 20px}
.divider::before,.divider::after{content:'';flex:1;height:1px;background:rgba(255,255,255,.14)}
.auth-alt{text-align:center;font-size:13.5px;color:var(--muted);margin-top:18px}
.auth-alt a{color:#fff;font-weight:600}
.notice{
  padding:12px 15px;border-radius:8px;font-size:13.5px;font-weight:600;margin-bottom:18px;
  background:rgba(226,58,58,.16);border:1px solid rgba(226,58,58,.4);
}
.notice.ok{background:rgba(60,190,140,.16);border-color:rgba(60,190,140,.4)}

/* ---------- plans ---------- */
.plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px;margin-top:26px}
.plan{
  background:var(--glass);border:1px solid var(--glass-line);border-radius:12px;padding:28px 26px;
  display:flex;flex-direction:column;
}
.plan.featured{border-color:rgba(255,255,255,.4);background:rgba(255,255,255,.1)}
.plan .ribbon{
  font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:10px;
}
.plan h3{font-size:19px;font-weight:800;margin-bottom:10px}
.plan .price{font-size:34px;font-weight:800;letter-spacing:-.02em;margin-bottom:4px}
.plan .price small{font-size:14px;font-weight:600;color:var(--muted)}
.plan ul{list-style:none;margin:20px 0 26px;display:flex;flex-direction:column;gap:10px}
.plan li{font-size:14px;color:var(--muted);display:flex;gap:9px;line-height:1.45}
.plan li::before{content:'';width:6px;height:6px;border-radius:50%;background:#fff;flex-shrink:0;margin-top:7px}
.plan .btn{margin-top:auto}

/* ---------- account ---------- */
.acct-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px;margin-top:22px}

/* ---------- misc ---------- */
.page-head{padding:44px 0 6px}
.page-head h1{font-size:clamp(26px,3.2vw,38px);font-weight:800;letter-spacing:-.02em}
.page-head p{color:var(--muted);font-size:14.5px;margin-top:8px}
.empty-state{
  text-align:center;padding:70px 20px;color:var(--muted);font-size:14.5px;line-height:1.6;
}
.empty-state b{display:block;color:var(--text);font-size:17px;font-weight:700;margin-bottom:8px}
.searchbar{display:flex;gap:10px;max-width:560px;margin-top:20px}
.searchbar input{
  flex:1;padding:13px 16px;border-radius:7px;border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.22);color:var(--text);font-size:15px;font-family:inherit;
}
.chips{display:flex;gap:9px;flex-wrap:wrap;margin-top:20px}
.chip{
  padding:8px 16px;border-radius:999px;border:1px solid rgba(255,255,255,.18);
  font-size:13px;font-weight:600;color:var(--muted);
}
.chip:hover{color:#fff;border-color:rgba(255,255,255,.4)}
.chip.on{background:#fff;color:#0B1B2A;border-color:#fff}
.site-foot{
  margin-top:70px;padding:28px 0 0;border-top:1px solid rgba(255,255,255,.09);
  font-size:12.5px;color:var(--muted);display:flex;gap:20px;flex-wrap:wrap;align-items:center;
}
.site-foot a:hover{color:#fff}

@keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}

/* ---------- responsive: phone → tablet → desktop → TV ---------- */
@media (max-width:1000px){
  :root{--shell-pad:24px;--card-w:190px;--watch-chrome:120px}
  .hero{height:52vh;min-height:340px}
  .detail-body,.hero-body{max-width:92%}
}
@media (max-width:720px){
  :root{--rail-w:0px;--shell-pad:18px;--card-w:158px;--watch-chrome:0px}
  .rail{
    top:auto;left:0;right:0;bottom:0;width:100%;height:62px;flex-direction:row;
    padding:0;gap:0;border-top:1px solid rgba(255,255,255,.1);
    background:rgba(3,32,52,.92);
  }
  .rail-logo{display:none}
  .rail-nav{flex-direction:row;margin:0;height:100%}
  .rail-btn{height:100%;flex:1}
  .rail-btn.on::before{left:50%;top:0;transform:translateX(-50%);width:34px;height:3px;border-radius:0 0 3px 3px}
  .rail-foot{flex-direction:row;margin:0;width:auto;padding-right:14px}
  .stage{padding-bottom:90px}
  .hero{height:auto;min-height:0;margin-bottom:0}
  .hero-slide{position:relative;opacity:0;height:0;overflow:hidden}
  .hero-slide.on{opacity:1;height:auto}
  .hero-slide::after{background:linear-gradient(0deg,var(--bg-top) 6%,rgba(2,43,72,.25) 70%)}
  .hero-body{padding:150px 18px 30px;max-width:100%}
  .hero-dots{right:18px;bottom:14px}
  .hero h1{font-size:26px}
  .hero p{font-size:14px;margin-bottom:18px}
  .btn{padding:11px 18px;font-size:13.5px}
  .detail-body{padding:120px 18px 0;max-width:100%}
  .watch-info{padding:20px 18px 0}
  .section{margin-top:30px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(146px,1fr));gap:18px 12px}
  .rail-arrows{display:none}
}
@media (min-width:1800px){
  :root{--shell-pad:56px;--card-w:270px}
}

/* Smart TV / 10-foot mode: bigger type, visible focus, no hover reliance. */
body.tv{--card-w:300px;--shell-pad:64px;font-size:18px}
body.tv .card-label{font-size:19px}
body.tv .card-label small{font-size:16px}
body.tv .section-title{font-size:34px}
body.tv .btn{padding:16px 32px;font-size:19px}
body.tv .card.tv-focus{transform:scale(1.045);z-index:3}
body.tv .card{transition:transform .18s var(--ease),background .2s,border-color .2s}
body.tv .rail-btn{height:92px}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms !important;transition-duration:.001ms !important}
  html{scroll-behavior:auto}
  .strip{scroll-behavior:auto}
}

/* ---------- sign-up: plan picker, hints, confirmation screens ---------- */
.auth-wrap.auth-wide{max-width:520px}
.field-hint{font-size:12.5px;color:var(--muted);line-height:1.5;margin:-10px 0 16px}

.plan-picker{display:flex;flex-direction:column;gap:10px;margin-bottom:6px}
.pick{
  display:block;position:relative;cursor:pointer;border-radius:10px;
  border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.18);
  padding:14px 16px 14px 44px;transition:border-color .15s,background .15s;
}
.pick:hover{border-color:rgba(255,255,255,.34)}
.pick input{position:absolute;left:16px;top:50%;transform:translateY(-50%);accent-color:#fff;width:16px;height:16px}
.pick:has(input:checked){border-color:#fff;background:rgba(255,255,255,.1)}
.pick-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.pick-name{font-size:14.5px;font-weight:700}
.pick-name em{
  font-style:normal;font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;
  background:rgba(255,255,255,.9);color:#0B1B2A;padding:2px 6px;border-radius:4px;margin-left:8px;
}
.pick-price{font-size:14.5px;font-weight:700;white-space:nowrap}
.pick-price small{font-size:11.5px;font-weight:600;color:var(--muted)}
.pick-feat{display:block;font-size:12.5px;color:var(--muted);margin-top:5px;line-height:1.45}

.auth-icon{
  width:54px;height:54px;border-radius:50%;margin:0 auto 18px;display:grid;place-items:center;
  background:rgba(255,255,255,.12);color:#fff;
}
.auth-icon.bad{background:rgba(226,58,58,.18);color:#FF8A8A}
.auth-card .sub strong{color:#fff}

/* ---------- combined sign in / sign up ----------
   The two panes are toggled by hidden radios, so switching needs no
   JavaScript and no round trip to the server. */
.auth-tabs .tabtoggle{position:absolute;opacity:0;pointer-events:none;width:0;height:0}
.tabbar{
  display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:24px;
  background:rgba(0,0,0,.25);border-radius:10px;
}
.tabbar label{
  text-align:center;padding:11px 8px;border-radius:7px;cursor:pointer;
  font-size:14px;font-weight:700;color:var(--muted);transition:background .16s,color .16s;
  user-select:none;-webkit-user-select:none;
}
.tabbar label:hover{color:#fff}
#tab-login:checked    ~ .tabbar label[for="tab-login"],
#tab-register:checked ~ .tabbar label[for="tab-register"]{background:rgba(255,255,255,.14);color:#fff}

.auth-tabs .pane{display:none}
#tab-login:checked    ~ .pane-login,
#tab-register:checked ~ .pane-register{display:block;animation:paneIn .22s var(--ease)}
@keyframes paneIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

.linkish{color:#fff;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.linkish:hover{opacity:.85}

/* Keyboard users need to see which tab has focus. */
.tabtoggle:focus-visible ~ .tabbar label{outline:2px solid rgba(255,255,255,.6);outline-offset:2px}

@media (prefers-reduced-motion:reduce){
  #tab-login:checked ~ .pane-login,#tab-register:checked ~ .pane-register{animation:none}
}
