:root {
  --bg: #0f1220;
  --card: #1a1f35;
  --card-2: #232a45;
  --text: #e8ecf5;
  --muted: #9aa3bd;
  --accent: #ffd54a;
  --accent-2: #4ade80;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2140 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.site-header { position: relative; text-align: center; padding: 2.4rem 1rem 0.5rem; }
.site-header h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.subtitle { color: var(--muted); margin: 0.3rem 0 0; }

/* ---- Logo: "RPM" neon 3D ---- */
.logo-rpm {
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  color: #fff7df;
  text-shadow:
    1px 1px 0 #7a4a00, 2px 2px 0 #633c00, 3px 3px 0 #4d2f00, 4px 4px 0 #3a2300,
    0 0 7px rgba(255, 213, 74, 0.95),
    0 0 15px rgba(255, 180, 32, 0.75),
    0 0 28px rgba(255, 180, 32, 0.5);
}

/* ---- Seletor de idioma (dropdown no canto superior direito) ---- */
.flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  flex: none;
  vertical-align: middle;
}
.lang-dd {
  position: absolute;
  top: calc(0.9rem + env(safe-area-inset-top, 0px));
  right: 0.9rem;
  text-align: left;
  font-size: 0.85rem;
  z-index: 40;
}
.lang-dd > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text);
  user-select: none;
}
.lang-dd > summary::-webkit-details-marker { display: none; }
.lang-dd > summary::marker { content: ""; }
.lang-dd-caret { color: var(--muted); font-size: 0.7em; transition: transform 0.15s ease; }
.lang-dd[open] .lang-dd-caret { transform: rotate(180deg); }
.lang-dd-menu {
  position: absolute;
  right: 0;
  margin: 0.4rem 0 0;
  padding: 0.3rem;
  list-style: none;
  min-width: 165px;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.lang-dd-menu li { margin: 0; }
.lang-dd-menu a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.lang-dd-menu a:hover { background: rgba(255, 255, 255, 0.06); }
.lang-dd-menu a[aria-current="true"] {
  background: rgba(255, 213, 74, 0.14);
  color: var(--accent);
  font-weight: 700;
}
@media (max-width: 560px) {
  .lang-dd-name { display: none; }
}

/* ---- Doação: botões ---- */
.donate-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.1rem;
}
.donate-buttons .cta-btn {
  margin: 0;
  flex: 1 1 0;
  min-width: 88px;
  padding: 0.7rem 0.4rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donate-buttons .btn-pp { background: #0070ba; color: #fff; }
.donate-buttons .btn-mp { background: #00b1ea; color: #fff; }
.donate-buttons .btn-pix { background: #32bcad; color: #062a21; }

/* ---- Modal do Pix (popup central) ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}
.modal-box {
  position: relative;
  width: min(360px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem 1.2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-title { margin: 0 0 0.9rem; }
.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  opacity: 0.85;
}
.modal-close:hover { opacity: 1; }
.pix-qr {
  width: 220px;
  max-width: 80%;
  height: auto;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.pix-scan { color: var(--muted); font-size: 0.85rem; margin: 0.6rem 0 0.9rem; }
.pix-copy-label { font-weight: 600; font-size: 0.78rem; margin: 0 0 0.3rem; color: var(--muted); }
.pix-copy {
  display: block;
  max-width: 100%;
  margin: 0 auto 1rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}
#pix-copy-btn { width: 100%; margin: 0; }
#pix-copy-btn.copied { background: var(--accent-2); color: #06281f; }

.container { max-width: 760px; margin: 0 auto; padding: 1rem; }

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  margin: 1rem 0;
}

label { display: block; font-weight: 600; margin: 0.6rem 0 0.35rem; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.85em; }

input, select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d1120;
  color: var(--text);
  font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field { flex: 1 1 220px; }

button {
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.95rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd54a, #ffb020);
  color: #1a1200;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.7; cursor: progress; }

.disclaimer { color: var(--muted); font-size: 0.82rem; margin: 0.9rem 0 0; }

.hidden { display: none; }

/* ---- Resultado: destaque do Valor Provável ---- */
.probable-card {
  position: relative;
  text-align: center;
  background: linear-gradient(135deg, #1f2746, #121833);
  border: 1px solid rgba(255, 213, 74, 0.35);
}
.probable-card .label { color: var(--muted); margin: 0.2rem 0 0.1rem; font-weight: 700; letter-spacing: 0.5px; }
.probable-value {
  margin: 0.1rem 0 0.4rem;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 2px 20px rgba(255, 213, 74, 0.25);
}
.niche-line { color: var(--muted); margin: 0; font-size: 0.95rem; }

.confidence {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
}
.conf-high { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.conf-mid { background: rgba(255, 213, 74, 0.15); color: var(--accent); }
.conf-low { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

.ranges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin: 1rem 0; }
.range-item {
  background: var(--card-2);
  border-radius: 12px;
  padding: 0.8rem 0.5rem;
  text-align: center;
}
.range-item span { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 0.25rem; }
.range-item strong { font-size: 1.05rem; }
.range-item.premium { outline: 1px solid rgba(255, 213, 74, 0.3); }

.explain-card h3 { margin-top: 0; }
.explanation { margin: 0; padding-left: 1.1rem; }
.explanation li { margin: 0.35rem 0; color: #cfd6ea; }

.error-card { border-color: rgba(248, 113, 113, 0.5); color: #fca5a5; }

.info-card h2 { margin-top: 0; font-size: 1.15rem; }
.info-card p { color: #cfd6ea; margin: 0; }

.site-footer { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: 0.82rem; }
.site-footer a { color: var(--muted); }

/* Conteúdo / artigos */
.breadcrumb { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0.2rem; }
.breadcrumb a { color: var(--muted); }
.article-title { font-size: clamp(1.5rem, 5vw, 2.1rem); margin: 0.2rem 0 0.4rem; }
.article-meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 1rem; }
.article h2 { margin-top: 1.6rem; font-size: 1.25rem; }
.article h3 { margin-top: 1.1rem; font-size: 1.05rem; color: #e8ecf5; }
.article p, .article li { color: #cfd6ea; }
.article ul { padding-left: 1.2rem; }
.article li { margin: 0.3rem 0; }
.callout {
  background: rgba(255, 213, 74, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  color: #e8ecf5;
  font-size: 0.95rem;
}
.home-articles { padding-left: 1.1rem; margin: 0.4rem 0; }
.home-articles li { margin: 0.35rem 0; }
.home-articles a, .related a, .article-card h2 { color: var(--accent); }
.article-list { display: grid; gap: 1rem; }
.article-card { text-decoration: none; display: block; transition: transform 0.08s ease; }
.article-card:hover { transform: translateY(-2px); }
.article-card h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.article-card .desc { color: #cfd6ea; margin: 0 0 0.5rem; }
.related { padding-left: 1.1rem; }
.related li { margin: 0.35rem 0; }
.cta-box {
  text-align: center;
  background: linear-gradient(135deg, #1f2746, #121833);
  border: 1px solid rgba(255, 213, 74, 0.25);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin: 1.4rem 0;
}
.cta-box p { margin: 0 0 0.8rem; color: var(--text); font-weight: 600; }
.cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ffd54a, #ffb020);
  color: #1a1200;
  font-weight: 800;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

/* Ferramentas (afiliados) e doações */
.ad-disclosure { color: var(--muted); font-size: 0.78rem; margin: 0 0 0.6rem; }
.tools-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.tools-list li { background: var(--card-2); border-radius: 10px; }
.tools-list a { display: block; padding: 0.8rem 1rem; color: var(--text); text-decoration: none; }
.tools-list a:hover { background: rgba(255,255,255,0.04); }
.tools-list strong { color: var(--accent); }
.donate-card .pix code {
  background: #0d1120; padding: 0.3rem 0.6rem; border-radius: 8px;
  color: var(--accent-2); word-break: break-all; font-size: 0.95rem;
}
.donate-card p { color: #cfd6ea; }

/* Slots de anúncio */
.ad-slot {
  margin: 1rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-slot ins { width: 100%; }

/* Banner de consentimento (LGPD) */
.consent-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 720px;
  margin: 0 auto;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
  z-index: 50;
}
.consent-banner p { margin: 0 0 0.7rem; font-size: 0.9rem; color: var(--text); }
.consent-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.consent-actions button { width: auto; margin: 0; padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.btn-secondary { background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,0.2); }

@media (max-width: 560px) {
  .ranges { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Admin ---- */
.admin-wrap { max-width: 420px; margin: 4rem auto; padding: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat { background: var(--card); border-radius: 12px; padding: 1.1rem; text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat .cap { color: var(--muted); font-size: 0.85rem; }
table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.9rem; }
.logout { color: var(--muted); }

/* Gráfico de barras do dashboard */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  height: 170px;
  padding: 0.5rem 0 0;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar {
  width: 70%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--accent), #ffb020);
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}
.bar-val { font-size: 0.8rem; color: var(--text); margin-bottom: 0.25rem; font-weight: 700; }
.bar-label { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }
