/* ==========================================================================
   Virtua TV — High Contrast, White Text, Selectable Plans (Mobile-First)
   ========================================================================== */

:root {
  --bg: #030712;
  --border: rgba(255, 255, 255, 0.16);
  --border-active: #00f2fe;
  --accent: #00f2fe;
  --green: #00f076;
  --grad-main: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --grad-green: linear-gradient(135deg, #00f076 0%, #00c853 100%);
  --font: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: #ffffff;
  font-family: var(--font);
  overflow: hidden;
}

/* Container que ocupa 100% da tela */
.app-viewport {
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: radial-gradient(circle at 50% 10%, #112554 0%, #030712 80%);
}

/* Header */
.app-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
}

.app-top .logo img {
  height: 38px;
  width: auto;
}

.btn-support,
.app-top .btn-support {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 242, 254, 0.15);
  border: 1.5px solid var(--accent);
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none !important;
}

.btn-support:visited,
.app-top .btn-support:visited {
  color: #ffffff !important;
}

.btn-support svg,
.app-top .btn-support svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
}

/* Wrapper das Telas */
.screens-wrapper {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 12px 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Títulos */
.screen-header {
  flex: 0 0 auto;
  text-align: center;
  margin-bottom: 6px;
}

.screen-title {
  font-size: clamp(2.1rem, 7.5vw, 2.7rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 4px;
}

.screen-title span {
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.screen-sub {
  color: #e2e8f0;
  font-size: 1.05rem;
  font-weight: 600;
}

/* ==========================================================================
   TELA 1: GRID DE APARELHOS (Sem subtítulos, texto 100% branco)
   ========================================================================== */
.device-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0;
}

.device-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  cursor: pointer;
  color: #ffffff !important;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.device-btn:active {
  transform: scale(0.96);
  border-color: var(--accent);
  background: rgba(0, 242, 254, 0.25);
}

.device-btn .d-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.device-btn .d-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.device-btn .d-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.2;
}

.device-btn strong {
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   TELAS DE CONTEÚDO
   ========================================================================== */
.card-content-box {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.app-card-view {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 24px 18px;
  text-align: center;
}

.app-card-view .app-logo-big {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.app-card-view .app-logo-big img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.app-card-view .app-logo-big.kp {
  background: var(--grad-green);
  color: #000;
  font-size: 2.2rem;
  font-weight: 900;
}

.app-card-view h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
}

.app-card-view p {
  color: #e2e8f0;
  font-size: 1.15rem;
  font-weight: 600;
}

/* A instrução de instalação é a ação principal desta tela. */
.app-card-view .install-app-instruction {
  color: #ffffff;
  font-size: clamp(1.18rem, 5.1vw, 1.42rem);
  font-weight: 900;
  line-height: 1.25;
  margin: 10px auto 0;
  max-width: 290px;
  text-wrap: balance;
}

/* Apps de Smart TV: logos contidos e duas escolhas visíveis sem rolagem. */
#screen-install .screen-title {
  font-size: clamp(1.75rem, 6.8vw, 2.25rem);
}

#screen-install .screen-sub {
  font-size: 0.98rem;
  line-height: 1.25;
}

/* A configuração precisa priorizar a escolha do app, não espaço em branco. */
#screen-install .card-content-box {
  justify-content: flex-start;
  gap: 8px;
  padding-top: 8px;
}

#install-smarttv-box .app-card-view {
  padding: 16px 14px 14px;
}

#install-smarttv-box .app-card-view h2 {
  font-size: 1.55rem;
  margin-bottom: 2px;
}

#install-smarttv-box .install-app-instruction {
  font-size: clamp(1.02rem, 4.6vw, 1.18rem);
  line-height: 1.22;
  margin-top: 6px;
}

.tv-apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tv-app-item {
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-rows: 58px auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  background: rgba(3, 7, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
}

.tv-app-item img {
  display: block;
  width: 100%;
  height: 58px;
  max-width: 112px;
  object-fit: contain;
}

.tv-app-item strong {
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

#install-smarttv-box + .compact-code {
  padding: 9px 12px;
}

#install-smarttv-box + .compact-code .code-tip {
  font-size: 0.93rem;
  line-height: 1.2;
}

/* Ativação guiada na própria Virtua: uma decisão por vez no celular. */
.activation-flow {
  width: 100%;
}

.activation-step {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  text-align: center;
}

.activation-step[hidden],
.activation-modal[hidden] {
  display: none;
}

.activation-kicker {
  color: var(--accent);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.activation-step h2 {
  margin: 4px 0 3px;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.08;
}

.activation-step > p:not(.activation-feedback):not(.activation-hint):not(.activation-selected-app) {
  color: #dbeafe;
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.25;
}

.activation-search,
.activation-input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: 13px;
  background: rgba(3,7,18,.72);
  color: #fff;
  font: 700 .98rem var(--font);
  outline: none;
}

.activation-search:focus,
.activation-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,242,254,.14);
}

.activation-search::placeholder,
.activation-input::placeholder {
  color: #94a3b8;
}

.activation-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(280px, 34dvh);
  margin: 10px 0;
  padding: 2px;
  overflow-y: auto;
  scrollbar-color: var(--accent) transparent;
}

.activation-app-choice {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(3,7,18,.72);
  color: #fff;
  font: 800 .78rem/1.12 var(--font);
  text-align: left;
  cursor: pointer;
}

.activation-app-choice img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 9px;
  background: #071120;
  object-fit: contain;
}

.activation-app-choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.activation-app-choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(0,242,254,.15);
  box-shadow: 0 0 0 2px rgba(0,242,254,.13);
  color: var(--accent);
}

.activation-empty {
  grid-column: 1 / -1;
  padding: 12px;
  color: #cbd5e1;
  font-weight: 700;
}

.activation-next {
  min-height: 50px;
  font-size: 1.04rem;
}

.activation-next:disabled,
.activation-step .btn-action:disabled {
  cursor: not-allowed;
  opacity: .46;
  box-shadow: none;
}

.activation-label {
  display: block;
  margin: 11px 0 -5px;
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
  text-align: left;
}

.activation-hint,
.activation-feedback {
  margin: 9px 0 0;
  color: #cbd5e1;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.25;
}

.activation-feedback {
  color: #fecaca;
}

.activation-step .btn-action {
  min-height: 50px;
  margin-top: 12px;
  font-size: 1.04rem;
}

.activation-step .btn-ghost {
  margin-top: 9px;
}

.activation-selected-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 9px auto 2px;
  padding: 5px 12px;
  border: 1px solid rgba(0,242,254,.38);
  border-radius: 999px;
  background: rgba(0,242,254,.1);
  color: var(--accent);
  font-size: .92rem;
  font-weight: 900;
}

.activation-success {
  padding: 27px 18px;
}

.activation-success-icon,
.activation-modal-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 11px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0,240,118,.18);
  border: 1.5px solid var(--green);
  color: var(--green);
  font-size: 1.7rem;
  font-weight: 900;
}

.activation-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(5px);
}

.activation-modal-card {
  width: min(100%, 360px);
  padding: 28px 22px 22px;
  border: 1.5px solid rgba(0,242,254,.42);
  border-radius: 24px;
  background: linear-gradient(145deg, #17335a, #071120);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  text-align: center;
}

.activation-modal-card h2 {
  color: #fff;
  font-size: 1.65rem;
  line-height: 1.08;
}

.activation-modal-card p {
  margin: 11px 0 18px;
  color: #dbeafe;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}

/* Código 0022 */
.code-box {
  background: rgba(0, 240, 118, 0.15);
  border: 1.5px dashed var(--green);
  border-radius: 16px;
  padding: 10px 12px;
  text-align: center;
}

.code-box .code-label {
  font-size: 0.78rem;
  font-weight: 900;
  color: #78ffb5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-box .code-num {
  font-size: clamp(1.7rem, 6.8vw, 2.15rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffffff;
  margin: 1px 0;
  text-shadow: 0 0 14px rgba(0, 240, 118, 0.38);
}

.code-box .code-tip {
  font-size: 0.92rem;
  font-weight: 700;
  color: #d6ffe8;
  line-height: 1.28;
}

.code-box.compact-code {
  padding: 12px 14px;
}

.code-box.compact-code .code-tip {
  font-size: 1.02rem;
  font-weight: 800;
}

/* Banner Grande de Notificação de Credenciais Enviadas */
.credentials-banner {
  background: linear-gradient(135deg, rgba(0, 240, 118, 0.22) 0%, rgba(0, 200, 83, 0.12) 100%);
  border: 2px solid var(--green);
  border-radius: 18px;
  padding: 16px 14px;
  text-align: center;
  box-shadow: 0 0 25px rgba(0, 240, 118, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.credentials-banner .cb-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.credentials-banner p {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.credentials-banner strong {
  color: #00f2fe;
  font-weight: 900;
}

/* ==========================================================================
   PLANOS SELECIONÁVEIS (Clicáveis)
   ========================================================================== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.p-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--border);
  border-radius: 20px;
  text-align: center;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s ease;
}

.p-item:active {
  transform: scale(0.96);
}

.p-item.selected {
  border-color: var(--green);
  background: rgba(0, 240, 118, 0.2);
  box-shadow: 0 0 25px rgba(0, 240, 118, 0.35);
}

.p-item small {
  display: block;
  font-size: 0.9rem;
  color: #cbd5e1;
  font-weight: 800;
  text-transform: uppercase;
}

.p-item strong {
  display: block;
  font-size: 1.65rem;
  font-weight: 900;
  color: #ffffff;
  margin-top: 4px;
}

.p-item.selected strong {
  color: var(--green);
}

.p-item .badge-best {
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--green);
  color: #000;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

/* Botões */
.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 14px 20px;
  border-radius: 18px;
  background: var(--grad-main);
  color: #000000 !important;
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.35);
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}

.btn-action:active {
  transform: scale(0.97);
}

.btn-action.green {
  background: var(--grad-green);
  box-shadow: 0 10px 30px rgba(0, 240, 118, 0.35);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid var(--border);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent);
}

.btn-ghost {
  display: block;
  text-align: center;
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 800;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}

/* Bottom Bar */
.app-bottom {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px 14px calc(10px + var(--safe-b));
  background: rgba(7, 13, 30, 0.98);
  border-top: 1.5px solid var(--border);
  z-index: 30;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 800;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

/* Desktop */
.desktop-footer {
  display: none;
}

@media (min-width: 769px) {
  html, body {
    overflow-y: auto;
    height: auto;
  }
  
  .app-viewport {
    height: auto;
    min-height: 85vh;
    padding-bottom: 40px;
  }
  
  .screens-wrapper {
    max-width: 580px;
    min-height: 640px;
    margin: 20px auto;
  }

  .app-bottom {
    display: none;
  }

  .desktop-footer {
    display: block;
    background: #02040a;
    border-top: 1px solid var(--border);
    padding: 50px 0 35px;
    color: #94a3b8;
    font-size: 0.92rem;
  }

  .footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 36px;
  }

  .footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
  }

  .footer-col ul {
    list-style: none;
  }

  .footer-col li {
    margin-bottom: 10px;
  }

  .footer-col a {
    color: #94a3b8;
    text-decoration: none;
    transition: 0.2s;
  }

  .footer-col a:hover {
    color: var(--accent);
  }

  .footer-bottom {
    max-width: 1080px;
    margin: 35px auto 0;
    padding: 24px 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
  }
}
