/* Paleta do pampa: verde-campo, vermelho e amarelo da bandeira do RS sobre papel claro. */
:root {
  --paper: #F7F8F5;
  --card: #FFFFFF;
  --ink: #123524;        /* verde-campo profundo: texto e tela da TV */
  --ink-soft: #4B5F54;
  --line: #DCE3DD;
  --red: #C8102E;        /* ação de pagar */
  --red-dark: #A00C24;
  --sun: #F2C230;        /* teste grátis, destaques */
  --sun-dark: #D9A916;
  --green: #1F8A4C;      /* status ativo */
  --radius-lg: 22px;
  --radius: 12px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.5 var(--font); font-variation-settings: "wdth" 100;
  min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

/* ---------- topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; max-width: 620px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-weight: 900; font-size: 22px; font-variation-settings: "wdth" 120; letter-spacing: -0.01em; }
.brand-text small { font-size: 12px; color: var(--ink-soft); }
.support {
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--green);
  padding: 8px 12px; border-radius: 999px; background: #E6F2EA;
}

main { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 4px 20px 32px; }
.loading { color: var(--ink-soft); padding: 40px 0; }

/* ---------- tipografia ---------- */
h1 {
  font-size: clamp(34px, 8vw, 46px); line-height: 1.02; margin: 18px 0 10px;
  font-weight: 850; font-variation-settings: "wdth" 115; letter-spacing: -0.02em;
}
h2 { font-size: 22px; line-height: 1.2; margin: 0 0 6px; font-weight: 750; font-variation-settings: "wdth" 108; }
p { margin: 0 0 14px; }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 34em; }

/* ---------- abas ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 22px 0 14px;
  background: #E9EEEA; padding: 4px; border-radius: 14px;
}
.tabs button {
  border: 0; background: transparent; padding: 11px 6px; border-radius: 10px; cursor: pointer;
  font-weight: 650; font-size: 15px; color: var(--ink-soft);
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(18,53,36,.12); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 20px; }
.panel > p { color: var(--ink-soft); }

/* ---------- formulários ---------- */
.stack { display: grid; gap: 14px; margin-top: 12px; }
label { display: grid; gap: 6px; min-width: 0; font-weight: 600; font-size: 15px; }
.opt { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=tel], input[type=email], input[type=password], input:not([type]) {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #FCFDFC; font-size: 17px; font-weight: 400;
}
input:focus { border-color: var(--ink); outline: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius); padding: 15px 18px; cursor: pointer;
  font-weight: 750; font-size: 17px; text-decoration: none; text-align: center;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: var(--sun-dark); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-sm { padding: 10px 14px; font-size: 15px; }

/* ---------- planos ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.plan {
  position: relative; min-width: 0; text-align: left; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 16px; padding: 14px 14px 12px; cursor: pointer;
}
.plan[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.plan .p-title { display: block; font-weight: 750; font-size: 16px; }
.plan .p-price { display: block; font-weight: 850; font-size: clamp(20px, 6vw, 26px); font-variation-settings: "wdth" 112; letter-spacing: -0.02em; margin-top: 2px; }
.plan .p-month { display: block; font-size: 13px; color: var(--ink-soft); min-height: 1.4em; }
.plan .p-badge {
  position: absolute; top: -10px; right: 10px; background: var(--sun); color: var(--ink);
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}

.screens { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 4px; }
.screens-label { font-weight: 600; font-size: 15px; }
.screens-note { flex-basis: 100%; color: var(--ink-soft); }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 44px; height: 40px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 30px; text-align: center; font-weight: 800; font-size: 18px; }

.methods { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.methods legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.method { display: block; cursor: pointer; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method span { display: grid; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.method small { font-weight: 400; color: var(--ink-soft); }
.method input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.method input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---------- pagamento ---------- */
.pay .qr {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; width: min(300px, 100%); margin: 8px auto 16px;
}
.pay .qr img { width: 100%; image-rendering: pixelated; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; font-size: 14px; }
.waiting { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-weight: 600; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--green); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.hint { color: var(--ink-soft); font-size: 15px; }
.hint a { cursor: pointer; text-decoration: underline; }

/* ---------- conta: a "tela" da TV é o elemento-assinatura ---------- */
.screen {
  margin-top: 14px; background: var(--ink); color: #EAF3EC; border-radius: 26px;
  padding: 20px 22px 18px; position: relative;
  border: 6px solid #0B2318; box-shadow: 0 18px 0 -10px #0B2318;
}
.screen-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.kind { font-weight: 700; color: var(--sun); }
.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.state.on { color: #5FD08E; }
.state.off { color: #FF8A9A; }
.days { margin: 10px 0 0; display: flex; align-items: baseline; gap: 10px; }
.days-num { font-size: clamp(72px, 22vw, 108px); font-weight: 900; line-height: .9; font-variation-settings: "wdth" 70; letter-spacing: -0.03em; }
.days-label { font-size: 20px; font-weight: 600; }
.until { color: #B8CDBF; margin: 4px 0 12px; }
.signal { height: 8px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.signal i { display: block; height: 100%; width: 0; background: var(--sun); border-radius: inherit; transition: width .9s cubic-bezier(.2,.7,.2,1); }
.online { margin: 12px 0 0; font-size: 14px; color: #B8CDBF; }

.cta-row { display: grid; gap: 10px; margin: 26px 0 8px; }

.creds { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.creds dl { margin: 10px 0 0; display: grid; gap: 12px; }
.creds dl > div { display: grid; gap: 2px; }
.creds dt { font-size: 13px; color: var(--ink-soft); }
.creds dd { margin: 0; display: flex; align-items: center; gap: 10px; }
.creds code { font: 600 16px/1.3 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; flex: 1; }
.copy { border: 0; background: #E9EEEA; border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 600; cursor: pointer; flex: none; }
.creds-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.renew { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.renew-text { color: var(--ink-soft); }

.account-foot { display: flex; justify-content: space-between; margin-top: 20px; }
.linkbtn { background: none; border: 0; padding: 8px 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* ---------- aviso ---------- */
#toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(18,53,36,.25); z-index: 10;
}
#toast.err { background: var(--red); }

.foot { max-width: 620px; margin: 0 auto; padding: 8px 20px 28px; font-size: 13px; color: var(--ink-soft); }

@media (max-width: 380px) {
  .plans { grid-template-columns: 1fr; }
  .tabs button { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
