:root{
  --bg:#041008;--panel:#091b11;--panel2:#0d2719;--line:#1f6b42;
  --green:#24e678;--green2:#37ef8a;--text:#f5fff8;--muted:#a9cbb6;
  --danger:#ff7a7a;--ok:#c8f8da
}
*{box-sizing:border-box}
html,body{margin:0;width:100%;min-height:100%;background:var(--bg)}
body{
  color:var(--text);font:14px/1.25 Arial,sans-serif;
  background:radial-gradient(circle at 50% -40%,#12391f 0,#07150e 45%,#030805 100%);
}
.wrap{
  width:min(980px,calc(100% - 28px));
  min-height: 100vh;margin:0 auto;
  display:grid;grid-template-rows:auto 1fr auto;
  gap:8px;padding:10px 0 8px
}
.brand{display:flex;align-items:center;gap:10px;min-height:48px}
.logo{
  width:46px;height:46px;border:2px solid var(--green);border-radius:50%;
  display:grid;place-items:center;font-weight:900;font-size:15px;
  box-shadow:0 0 14px #25e77955
}
.brand h1{margin:0;font-size:23px;line-height:1}
.brand small{display:block;margin-top:3px;color:var(--green);letter-spacing:.16em;font-size:10px}

.compact-card{
  align-self:start;background:linear-gradient(180deg,#0b2116,#07160f);
  border:1px solid #1b613b;border-radius:15px;padding:14px 16px;
  box-shadow:0 14px 42px #0006
}

/* Tela inicial: preservada */
.lookup-line{
  display:grid;grid-template-columns:auto 1fr;align-items:center;gap:18px
}
.lookup-title{font-size:18px;font-weight:800;white-space:nowrap}
.lookup-controls{
  display:grid;grid-template-columns:minmax(220px,1fr) 145px;gap:8px
}
.code{
  height:40px;border-radius:9px;border:1px solid #2b6845;background:#fff;color:#777;
  padding:7px 12px;font-size:20px;font-weight:900;letter-spacing:.22em;text-align:center;outline:none
}
.code:focus{border-color:var(--green);box-shadow:0 0 0 2px #25e7791f}

.btn{
  border:0;border-radius:9px;min-height:38px;padding:7px 13px;
  font-weight:900;font-size:13px;cursor:pointer;transition:.15s ease
}
.btn:hover{filter:brightness(1.05)}.btn:disabled{opacity:.58;cursor:wait}
.primary{background:var(--green);color:#041109}
.secondary{background:#123722;color:#fff;border:1px solid #2a7e4e}
.hidden{display:none!important}

/* Estado localizado: tudo em uma única tela */
.connected-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  min-height:38px;padding:4px 0 7px;margin:0 0 6px;
  border-bottom:1px solid #184f32
}
.connected-left{display:flex;align-items:center;gap:7px;min-width:0}
.dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 9px #25e779}
.connected-left strong{font-size:13px;color:#d5ffe5;white-space:nowrap}
.code-inline{font-size:12px;color:var(--muted);white-space:nowrap}
.code-inline b{color:#fff;letter-spacing:.08em}
.link-btn{
  border:0;background:transparent;color:#baf4cf;font-weight:800;font-size:11px;
  padding:2px 5px;cursor:pointer;text-decoration:underline
}
.send-top{
  min-width:150px;min-height:34px;padding:5px 12px;font-size:12px
}

.msg{
  margin:0 0 6px;padding:5px 8px;border-radius:7px;
  background:#102b1b;color:#d8f6e3;font-size:11px
}
.msg.err{background:#401919;color:#ffe2e2}
.msg.ok{background:#123b25;color:var(--ok);border:1px solid #2d8151}

.setup{padding-top:0}
.compact-tabs{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:7px
}
.compact-tabs .btn{min-height:34px;padding:5px 10px}

/* M3U: URL + EPG na mesma linha */
.m3u-form{
  display:grid;grid-template-columns:1.55fr 1fr;gap:8px;align-items:end
}

/* Xtream: servidor em cima, usuário e senha juntos embaixo */
.xtream-form{display:grid;gap:6px}
.credentials-row{
  display:grid;grid-template-columns:1fr 1fr;gap:8px
}

.field{margin:0;min-width:0}
.field label{
  display:block;margin-bottom:3px;color:#c9ead6;font-weight:800;font-size:11px
}
.field input{
  width:100%;height:34px;padding:6px 9px;border-radius:8px;
  border:1px solid #2a6644;background:#06110b;color:#fff;font-size:12px;outline:none
}
.field input:focus{border-color:var(--green);box-shadow:0 0 0 2px #25e7791f}

.notice{
  margin:8px 0 0;padding:6px 8px;border-radius:7px;background:#0f301e;
  color:#ddf6e6;font-size:10.5px;line-height:1.2
}
.footer{
  align-self:end;color:var(--muted);font-size:11.5px;
  display:flex;align-items:center;gap:14px;min-height:24px;padding-bottom:2px
}
.footer a{color:#baf4cf;text-decoration:none;font-weight:700}
.footer span{margin-left:auto}
.legal h2{margin-top:28px}.legal p,.legal li{color:#dceee3}

/* No desktop normal, não há barra lateral de rolagem */
@media(min-width:701px) and (min-height:560px){
  body{overflow:hidden}
  .wrap{min-height: 100vh;min-height:0}
  .compact-card.connected{padding-top:10px;padding-bottom:10px}
}

/* Em telas menores/celular, a rolagem continua permitida para não cortar campos */
@media(max-width:700px){
  body{overflow:auto}
  .wrap{height:auto;min-height: 100vh;width:min(100% - 18px,620px);padding:9px 0}
  .brand h1{font-size:20px}.logo{width:42px;height:42px}
  .compact-card{padding:12px}
  .lookup-line{grid-template-columns:1fr;gap:8px}
  .lookup-title{font-size:16px}
  .lookup-controls{grid-template-columns:1fr 120px}
  .connected-head{align-items:flex-start}
  .connected-left{flex-wrap:wrap}
  .m3u-form,.credentials-row{grid-template-columns:1fr}
  .footer{flex-wrap:wrap;gap:10px}
  .footer span{margin-left:0}
}


/* 1.5 — Xtream: usuário e senha obrigatoriamente lado a lado no desktop */
.xtream-form .credentials-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  gap:10px !important;
  width:100% !important;
}
.xtream-form .credential-field{
  min-width:0 !important;
  width:100% !important;
}
.xtream-form .credential-field input{
  width:100% !important;
}
@media(min-width:701px){
  .xtream-form .credentials-row{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
  }
}
@media(max-width:700px){
  .xtream-form .credentials-row{
    grid-template-columns:1fr !important;
  }
}


/* =========================================================
   WR VISION PORTAL 1.7 — POLIMENTO VISUAL
   Mantém o fluxo compacto e sem rolagem no desktop.
   ========================================================= */

@media (min-width: 701px) {
  html, body.portal-polido {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
  }

  body.portal-polido {
    min-height: 100vh;
    background:
      radial-gradient(circle at 50% 8%, rgba(37,231,121,.09), transparent 34%),
      radial-gradient(circle at 15% 88%, rgba(37,231,121,.035), transparent 28%),
      linear-gradient(180deg, #06140d 0%, #030a06 100%);
  }

  body.portal-polido .wrap {
    width: min(1040px, calc(100% - 46px)) !important;
    height: 100vh !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  body.portal-polido .brand {
    min-height: 0 !important;
    margin: 0 0 18px 8px !important;
    gap: 13px !important;
  }

  body.portal-polido .logo {
    width: 54px !important;
    height: 54px !important;
    font-size: 17px !important;
    border-width: 2px !important;
    box-shadow: 0 0 24px rgba(37,231,121,.22) !important;
  }

  body.portal-polido .brand h1 {
    font-size: 29px !important;
    letter-spacing: -.02em !important;
  }

  body.portal-polido .brand small {
    margin-top: 5px !important;
    font-size: 11px !important;
    letter-spacing: .20em !important;
  }

  body.portal-polido .compact-card {
    width: 100% !important;
    min-height: 0 !important;
    padding: 20px 22px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(44,176,101,.52) !important;
    background:
      linear-gradient(180deg, rgba(11,35,22,.98), rgba(7,23,15,.98)) !important;
    box-shadow:
      0 22px 60px rgba(0,0,0,.32),
      inset 0 1px 0 rgba(255,255,255,.018) !important;
  }

  /* Tela inicial */
  body.portal-polido .lookup-line {
    grid-template-columns: 205px minmax(0,1fr) !important;
    gap: 18px !important;
  }

  body.portal-polido .lookup-title {
    font-size: 20px !important;
    color: #f4fff8 !important;
  }

  body.portal-polido .lookup-controls {
    grid-template-columns: minmax(0,1fr) 154px !important;
    gap: 10px !important;
  }

  body.portal-polido .code {
    height: 46px !important;
    border-radius: 11px !important;
    font-size: 22px !important;
  }

  body.portal-polido .btn {
    min-height: 42px !important;
    border-radius: 10px !important;
    letter-spacing: .015em !important;
  }

  /* Estado localizado */
  body.portal-polido .connected-head {
    min-height: 46px !important;
    padding: 0 0 12px !important;
    margin: 0 0 12px !important;
  }

  body.portal-polido .connected-left {
    gap: 10px !important;
  }

  body.portal-polido .connected-left strong {
    font-size: 15px !important;
  }

  body.portal-polido .code-inline {
    font-size: 13px !important;
  }

  body.portal-polido .link-btn {
    font-size: 12px !important;
    color: #baf4cf !important;
    text-underline-offset: 3px !important;
  }

  body.portal-polido .send-top {
    min-width: 166px !important;
    min-height: 40px !important;
    font-size: 12.5px !important;
  }

  body.portal-polido .compact-tabs {
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  body.portal-polido .compact-tabs .btn {
    min-height: 42px !important;
    font-size: 13px !important;
  }

  body.portal-polido .m3u-form {
    gap: 12px !important;
    grid-template-columns: 1.45fr .95fr !important;
  }

  body.portal-polido .xtream-form {
    gap: 10px !important;
  }

  body.portal-polido .credentials-row {
    gap: 12px !important;
  }

  body.portal-polido .field label {
    margin-bottom: 5px !important;
    font-size: 12px !important;
    color: #d4efde !important;
  }

  body.portal-polido .field input {
    height: 42px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    background: rgba(3,15,9,.92) !important;
    border-color: rgba(60,143,93,.72) !important;
  }

  body.portal-polido .field input:focus {
    border-color: #25e779 !important;
    box-shadow: 0 0 0 3px rgba(37,231,121,.10) !important;
  }

  body.portal-polido .notice {
    margin: 12px 0 0 !important;
    padding: 8px 11px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    color: #d8efe1 !important;
    background: rgba(18,58,35,.72) !important;
  }

  body.portal-polido .msg {
    margin-bottom: 10px !important;
    padding: 7px 10px !important;
  }

  body.portal-polido .footer {
    width: 100% !important;
    min-height: 0 !important;
    margin-top: 15px !important;
    padding: 0 8px !important;
    align-self: auto !important;
    font-size: 12px !important;
    color: #8fbca1 !important;
  }

  body.portal-polido .footer a {
    color: #bdf4d0 !important;
    transition: color .15s ease !important;
  }

  body.portal-polido .footer a:hover {
    color: #25e779 !important;
  }
}

/* Notebook com pouca altura: mantém elegância sem gerar rolagem. */
@media (min-width: 701px) and (max-height: 650px) {
  body.portal-polido .brand {
    margin-bottom: 11px !important;
  }

  body.portal-polido .logo {
    width: 48px !important;
    height: 48px !important;
  }

  body.portal-polido .brand h1 {
    font-size: 26px !important;
  }

  body.portal-polido .compact-card {
    padding: 15px 18px !important;
  }

  body.portal-polido .connected-head {
    min-height: 38px !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
  }

  body.portal-polido .compact-tabs {
    margin-bottom: 8px !important;
  }

  body.portal-polido .field input {
    height: 37px !important;
  }

  body.portal-polido .notice {
    margin-top: 8px !important;
    padding: 6px 9px !important;
  }

  body.portal-polido .footer {
    margin-top: 10px !important;
  }
}



/* =========================================================
   WR VISION PLAYER 2.2 — cabeçalho padronizado
   WR à esquerda + VISION PLAYER à direita + nome da página abaixo.
   ========================================================= */
.legal-brand{
  display:flex !important; flex-direction:row !important; align-items:center !important;
  justify-content:flex-start !important; gap:16px !important; margin:8px 0 22px !important;
  width:auto !important; height:auto !important;
}
.legal-brand-badge{
  display:block !important; flex:0 0 76px !important; width:76px !important; height:76px !important;
  max-width:76px !important; max-height:76px !important; object-fit:contain !important;
  filter:drop-shadow(0 0 13px rgba(62,255,53,.22));
}
.legal-brand-copy{display:block !important; min-width:0 !important; width:auto !important;}
.legal-brand-title{
  color:#fff !important; font-size:34px !important; line-height:.95 !important; font-weight:900 !important;
  letter-spacing:-.02em !important; white-space:nowrap !important; text-shadow:0 3px 14px rgba(0,0,0,.45);
}
.legal-brand-title span{color:#f4f6f5 !important;}
.legal-brand-title strong{color:#35ef42 !important; font-weight:900 !important;}
.legal-brand-line{display:flex !important; align-items:center !important; width:100% !important; height:9px !important; margin-top:6px !important;}
.legal-brand-line i{display:block !important; width:36% !important; height:4px !important; background:linear-gradient(90deg,#2c9c4f,#45ff35) !important; transform:none !important; border:0 !important; clip-path:polygon(0 100%,9% 0,96% 0,100% 40%,35% 55%,31% 100%);}
.legal-brand-line b{display:block !important; flex:1 !important; width:auto !important; height:2px !important; margin-left:-2px !important; background:linear-gradient(90deg,#33fd53,#7d9687) !important; opacity:.8 !important; border:0 !important;}
.legal-brand-subtitle{
  margin:4px 0 0 !important; color:#f4fff8 !important; font-size:11px !important; line-height:1.2 !important;
  font-weight:800 !important; letter-spacing:.24em !important; text-transform:uppercase !important; white-space:nowrap !important;
}
@media(max-width:700px){
  .legal-brand{gap:11px !important; margin:4px 0 17px !important;}
  .legal-brand-badge{flex-basis:58px !important; width:58px !important; height:58px !important; max-width:58px !important; max-height:58px !important;}
  .legal-brand-title{font-size:25px !important;}
  .legal-brand-subtitle{font-size:9px !important; letter-spacing:.18em !important;}
}


/* V5.1 — correção de rolagem das páginas internas */
html, body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto !important;
}

body {
    position: static;
}

main,
.page,
.page-content,
.content,
.content-wrapper,
.legal-page,
.legal-content,
.support-page,
.support-content,
.container {
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    overflow: visible !important;
}

body.privacy-page,
body.terms-page,
body.support-page {
    min-height: 100vh;
    height: auto !important;
    overflow-y: auto !important;
}

body.privacy-page main,
body.terms-page main,
body.support-page main {
    padding-bottom: 48px;
}
