/* Portal de Afiliados — mesma identidade do Portal LG Telecom (verde, Poppins, split layout) */
:root {
  --verde:        #2E7D32;
  --verde-dark:   #1B5E20;
  --verde-light:  #43A047;
  --verde-xlight: #D7EBBC;
  --branco:       #ffffff;
  --fundo:        #F8FAF8;
  --texto:        #1E293B;
  --texto-muted:  #64748B;
  --borda:        #E2E8F0;
  --vermelho:     #DC2626;
  --vermelho-bg:  #FEE2E2;
  --ambar:        #B45309;
  --ambar-bg:     #FEF3C7;
  --azul:         #1D4ED8;
  --radius:       12px;
  --shadow-form:  0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);
  --fonte: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--fonte);
  background: var(--fundo);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--verde); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ═══════════ AUTH (login / cadastro) ═══════════ */
.auth { display: flex; min-height: 100%; }
.auth[hidden] { display: none; }

/* -- painel de marca (esquerda) -- */
.brandside {
  flex: 0 0 44%;
  max-width: 560px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #133417 0%, #2E7D32 48%, #388E3C 100%);
  color: #fff;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brandside .logo { width: 190px; filter: brightness(0) invert(1); }
.brandside .pitch h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.brandside .pitch p { color: rgba(255,255,255,0.78); font-size: 15.5px; max-width: 34ch; }
.brandside ul { list-style: none; display: grid; gap: 16px; }
.brandside li { display: flex; align-items: center; gap: 13px; font-size: 14.5px; color: rgba(255,255,255,0.92); }
.brandside li svg { flex: none; width: 20px; height: 20px; opacity: .9; }
.brandside .badge {
  align-self: flex-start;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 5px 12px;
  border-radius: 999px;
}
.deco { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.06); pointer-events: none; }
.deco.a { width: 420px; height: 420px; right: -160px; top: -120px; }
.deco.b { width: 260px; height: 260px; right: -60px; bottom: -110px; background: rgba(255,255,255,0.05); }

/* -- painel do formulário (direita) -- */
.formside {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.box { width: 100%; max-width: 400px; }
.box .head { margin-bottom: 24px; }
.box .head h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.01em; }
.box .head p { color: var(--texto-muted); font-size: 14px; margin-top: 4px; }
.box .mobile-logo { display: none; width: 150px; margin-bottom: 26px; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--texto); margin: 16px 0 6px; }
label:first-of-type { margin-top: 0; }
.input, input[type=text], input[type=email], input[type=tel], input[type=password], input[type=url], select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: var(--fundo);
  border: 1px solid var(--borda);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus {
  border-color: var(--verde);
  background: var(--branco);
  box-shadow: 0 0 0 3px rgba(46,125,50,.14);
}
.pwd { position: relative; }
.pwd input { padding-right: 44px; }
.pwd button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 8px; line-height: 0;
}
.pwd button img { width: 20px; height: 20px; opacity: .6; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--texto-muted); margin-top: 6px; }

.btn {
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--verde);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--verde-dark); box-shadow: 0 8px 20px rgba(46,125,50,.28); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; box-shadow: none; }

.switch { margin-top: 20px; text-align: center; font-size: 14px; color: var(--texto-muted); }
.formfoot { margin-top: 28px; text-align: center; font-size: 12px; color: #94A3B8; }

.alert {
  margin-top: 16px; padding: 11px 13px; border-radius: 9px; font-size: 13px;
  display: flex; gap: 9px; align-items: flex-start;
}
.alert[hidden] { display: none; }
.alert svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.alert.err  { background: var(--vermelho-bg); border: 1px solid #FCA5A5; color: var(--vermelho); }
.alert.ok   { background: var(--verde-xlight); border: 1px solid #B6D9A0; color: var(--verde-dark); }
.alert.info { background: var(--ambar-bg); border: 1px solid #FCD34D; color: var(--ambar); }

/* ═══════════ DASHBOARD ═══════════ */
.app { display: none; }
.app.show { display: block; }
.app .bar {
  background: var(--branco);
  border-bottom: 1px solid var(--borda);
}
.app .bar-in {
  max-width: 1000px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.app .bar img { width: 140px; }
.app .bar .who { font-size: 13.5px; color: var(--texto-muted); }
.app .bar .who b { color: var(--texto); }

/* menu da conta (engrenagem) */
.usermenu { position: relative; display: flex; align-items: center; gap: 10px; }
.gear {
  width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  border: none; border-radius: 50%; cursor: pointer;
  color: var(--verde); background: var(--verde-xlight);
  transition: background .15s, transform .2s;
}
.gear svg { width: 18px; height: 18px; }
.gear:hover { background: #c8e6b4; }
.usermenu.open .gear { transform: rotate(60deg); background: var(--verde); color: #fff; }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 170px; padding: 6px;
  background: var(--branco); border: 1px solid var(--borda); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; font: inherit; font-size: 14px; color: var(--texto);
  background: none; border: none; border-radius: 8px; cursor: pointer;
}
.menu button:hover { background: var(--fundo); }
.menu button#mi-sair { color: var(--vermelho); }

/* modal */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,23,42,0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay[hidden] { display: none; }
.menu[hidden] { display: none; }
.dialog {
  width: 100%; max-width: 400px;
  background: var(--branco); border-radius: 16px; padding: 24px;
  box-shadow: var(--shadow-form);
}
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dialog-head h3 { font-size: 17px; font-weight: 600; }
.dialog .x {
  width: 30px; height: 30px; padding: 0; font-size: 22px; line-height: 1;
  color: var(--texto-muted); background: none; border: none; border-radius: 8px; cursor: pointer;
}
.dialog .x:hover { background: var(--fundo); color: var(--texto); }
.dialog .btn { margin-top: 18px; }

.pixinfo {
  font-size: 13px; padding: 10px 12px; border-radius: 9px; margin-bottom: 16px;
  background: var(--fundo); border: 1px solid var(--borda); color: var(--texto-muted);
}
.pixinfo b { color: var(--texto); }
.pixinfo .pill { margin-left: 6px; }

.container { max-width: 1000px; margin: 0 auto; padding: 26px 24px 64px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat {
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .k { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--texto-muted); }
.stat .v { font-size: 23px; font-weight: 700; margin-top: 7px; letter-spacing: -0.01em; }
.stat .v small { font-size: 14px; font-weight: 500; color: var(--texto-muted); }

.card {
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--radius);
  padding: 22px; margin-top: 22px;
}
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borda); }
th { font-weight: 600; color: var(--texto-muted); font-size: 12.5px; }
tr:last-child td { border-bottom: none; }

.pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.pill.ok   { background: var(--verde-xlight); color: var(--verde-dark); }
.pill.wait { background: var(--ambar-bg); color: var(--ambar); }
.pill.paid { background: #DBEAFE; color: var(--azul); }
.pill.dead { background: #F1F5F9; color: #64748B; }

.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.copy button {
  flex: none; padding: 0 14px; font: inherit; font-size: 13px; cursor: pointer;
  background: var(--fundo); color: var(--texto); border: 1px solid var(--borda); border-radius: 8px;
}
.copy button:hover { border-color: var(--verde); color: var(--verde-dark); }

.empty { color: var(--texto-muted); font-size: 13px; padding: 6px 2px; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ═══════════ responsivo ═══════════ */
@media (max-width: 900px) {
  .brandside { display: none; }
  .box .mobile-logo { display: block; }
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .app .bar img { width: 118px; }
}
