:root {
  --bg: #070b17;
  --bg-soft: #0b1020;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f7f9ff;
  --muted: #aeb8d6;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #55e7ff;
  --accent-2: #7c5cff;
  --good: #55f0a7;
  --warn: #ffd166;
  --bad: #ff6b6b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(85, 231, 255, 0.2), transparent 34rem),
    radial-gradient(circle at top right, rgba(124, 92, 255, 0.25), transparent 32rem),
    linear-gradient(180deg, #070b17 0%, #0b1020 48%, #060914 100%);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(7, 11, 23, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}
.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 35px rgba(85, 231, 255, 0.4);
}

.top-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.top-nav a {
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
}
.top-nav a:hover { color: var(--text); background: var(--panel); }

.section-pad { padding: clamp(2.4rem, 6vw, 6rem) clamp(1rem, 4vw, 4rem); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(280px, 0.93fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 76vh;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  margin: 0 0 0.7rem;
}

h1, h2, h3 { line-height: 1.05; letter-spacing: -0.045em; margin: 0; }
h1 { font-size: clamp(2.45rem, 6vw, 5.8rem); max-width: 930px; }
h2 { font-size: clamp(2rem, 4vw, 3.6rem); }
h3 { font-size: 1.28rem; }
p { color: var(--muted); }

.hero-text {
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  max-width: 740px;
  margin: 1.2rem 0 0;
}

.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101e;
  box-shadow: 0 18px 50px rgba(85, 231, 255, 0.25);
}
.btn.ghost { background: var(--panel); border: 1px solid var(--line); }
.btn.large { width: 100%; margin-top: 1rem; padding: 1rem 1.25rem; }
.btn.small { width: 100%; margin-top: 0.7rem; padding: 0.7rem 1rem; }

.trust-row { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 1.2rem; }
.trust-row span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.hero-panel {
  position: relative;
  min-height: 430px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.045));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(85,231,255,0.26), transparent 65%);
  filter: blur(2px);
}
.mini-gauge {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: min(72%, 320px);
  aspect-ratio: 1.3;
  border-radius: 320px 320px 60px 60px;
  border: 1px solid var(--line);
  background: rgba(7,11,23,0.72);
  display: grid;
  place-items: center;
}
.mini-gauge::before {
  content: "";
  position: absolute;
  width: 76%;
  height: 76%;
  border-top: 16px solid var(--accent);
  border-left: 16px solid rgba(124,92,255,0.55);
  border-right: 16px solid rgba(255,255,255,0.14);
  border-bottom: 16px solid transparent;
  border-radius: 50%;
  transform: rotate(45deg);
}
.mini-gauge strong { position: relative; margin-top: 3rem; font-size: 2rem; }
.mini-needle {
  position: absolute;
  width: 4px;
  height: 36%;
  background: var(--text);
  bottom: 24%;
  left: 50%;
  transform-origin: bottom;
  transform: rotate(38deg);
  border-radius: 999px;
}
.floating-card {
  position: absolute;
  padding: 1rem;
  min-width: 140px;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.floating-card span { color: var(--muted); display: block; font-size: 0.85rem; }
.floating-card strong { display: block; margin-top: 0.2rem; }
.floating-card.one { top: 1.2rem; right: 1.2rem; }
.floating-card.two { bottom: 1.2rem; left: 1.2rem; }

.ad-shell {
  margin: 0 clamp(1rem, 4vw, 4rem);
  min-height: 96px;
  border: 1px dashed rgba(255,255,255,0.22);
  border-radius: 22px;
  background: rgba(255,255,255,0.045);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}
.ad-shell span { color: var(--text); font-weight: 800; display: block; }
.ad-shell small { display: block; margin-top: 0.2rem; }

.test-card, .usage-card, .guide-card, .info-grid article, .history-section, .share-box {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.052));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.test-card { padding: clamp(1.1rem, 3vw, 2rem); }
.test-header { max-width: 840px; }
.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1rem;
  color: var(--muted);
  cursor: pointer;
}
.consent input { margin-top: 0.25rem; accent-color: var(--accent); }

.speed-layout {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1.1fr);
  gap: 1rem;
}
.gauge-card {
  background: rgba(7,11,23,0.48);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1rem;
}
.gauge { position: relative; width: 100%; max-width: 430px; margin: 0 auto; }
.gauge-svg { width: 100%; display: block; overflow: visible; }
.gauge-track, .gauge-progress {
  fill: none;
  stroke-linecap: round;
  stroke-width: 18;
}
.gauge-track { stroke: rgba(255,255,255,0.14); }
.gauge-progress {
  stroke: url(#none);
  stroke: var(--accent);
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  filter: drop-shadow(0 0 12px rgba(85,231,255,0.55));
}
.needle {
  stroke: var(--text);
  stroke-width: 4;
  stroke-linecap: round;
  transform-origin: 120px 125px;
  transform: rotate(-90deg);
  transition: transform 0.35s ease;
}
.needle-center { fill: var(--accent); }
.speed-number {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  text-align: center;
}
.speed-number strong { display: block; font-size: clamp(2.3rem, 6vw, 4rem); letter-spacing: -0.06em; }
.speed-number span { color: var(--muted); font-weight: 800; }
.status-text {
  min-height: 2.4rem;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  margin-top: 0.2rem;
}
.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metric-card {
  min-height: 170px;
  border: 1px solid var(--line);
  background: rgba(7,11,23,0.48);
  border-radius: 24px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.metric-card span { color: var(--muted); font-weight: 700; }
.metric-card strong { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -0.06em; margin-top: 0.35rem; }
.metric-card small { color: var(--muted); font-weight: 800; }

.progress-zone { margin-top: 1.2rem; }
.progress-info { display: flex; justify-content: space-between; color: var(--muted); font-weight: 800; margin-bottom: 0.55rem; }
.progress-bar { height: 12px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; }
.progress-bar div { width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.25s ease; }

.section-title { max-width: 780px; margin-bottom: 1.5rem; }
.section-title.compact { margin-bottom: 1rem; }
.usage-grid, .info-grid, .guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.usage-card, .guide-card, .info-grid article { padding: 1.1rem; }
.usage-card span { font-size: 2rem; }
.usage-card h3 { margin-top: 0.6rem; }
.usage-card.good { border-color: rgba(85,240,167,0.45); }
.usage-card.medium { border-color: rgba(255,209,102,0.45); }
.usage-card.bad { border-color: rgba(255,107,107,0.45); }
.usage-card.good h3::after { content: " — bom"; color: var(--good); }
.usage-card.medium h3::after { content: " — médio"; color: var(--warn); }
.usage-card.bad h3::after { content: " — ruim"; color: var(--bad); }

.share-box { margin-top: 1rem; padding: 1rem; }
.share-box textarea {
  width: 100%;
  min-height: 115px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7,11,23,0.55);
  color: var(--text);
  padding: 1rem;
}
.share-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }

.history-section { margin: 0 clamp(1rem, 4vw, 4rem); padding: clamp(1.1rem, 3vw, 2rem); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { text-align: left; padding: 0.85rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 0.9rem; }
td { color: var(--text); }

.info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.site-footer p { margin: 0.35rem 0 0; }
.site-footer nav { display: flex; gap: 0.9rem; flex-wrap: wrap; color: var(--muted); }

.legal-page {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem);
}
.legal-page article {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 2rem);
}
.legal-page h1 { font-size: clamp(2rem, 5vw, 4rem); }
.legal-page h2 { font-size: 1.5rem; margin-top: 2rem; }
.legal-page a { color: var(--accent); }

@media (max-width: 980px) {
  .hero, .speed-layout { grid-template-columns: 1fr; }
  .hero-panel { min-height: 360px; }
  .usage-grid, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .top-nav { justify-content: flex-start; }
  .top-nav a { padding: 0.5rem 0.55rem; font-size: 0.88rem; }
  .metrics-grid, .usage-grid, .info-grid, .guide-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-panel { display: none; }
  .ad-shell { margin-left: 1rem; margin-right: 1rem; }
  .history-section { margin-left: 1rem; margin-right: 1rem; }
}

/* V2 - resultado destacado, conexão, localização e conta */
.privacy-note {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(85, 231, 255, 0.25);
  background: rgba(85, 231, 255, 0.07);
  border-radius: 18px;
  color: var(--muted);
}
.privacy-note strong { color: var(--text); }

.connection-panel {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.connection-panel article {
  border: 1px solid var(--line);
  background: rgba(7, 11, 23, 0.42);
  border-radius: 20px;
  padding: 1rem;
  min-height: 118px;
}
.connection-panel span,
.result-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
}
.connection-panel strong,
.result-summary strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
}
.connection-panel small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  word-break: break-word;
}
.link-button {
  border: 0;
  padding: 0;
  margin-top: 0.45rem;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
.link-button:disabled { opacity: 0.7; cursor: default; }
.repeat-hint {
  margin: 0.75rem auto 0;
  text-align: center;
  max-width: 32rem;
  font-size: 0.9rem;
}

.result-summary {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.result-summary[hidden] { display: none; }
.result-summary > div {
  border: 1px solid var(--line);
  background: rgba(7, 11, 23, 0.45);
  border-radius: 20px;
  padding: 1rem;
}
.result-summary p { margin: 0.45rem 0 0; font-size: 0.95rem; }

.test-card.result-mode {
  background: linear-gradient(145deg, rgba(85,231,255,0.12), rgba(124,92,255,0.08) 45%, rgba(255,255,255,0.05));
  border-color: rgba(85, 231, 255, 0.28);
}
.test-card.result-mode .speed-layout {
  grid-template-columns: 1fr;
}
.test-card.result-mode .gauge-card {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: rgba(7, 11, 23, 0.64);
  box-shadow: 0 0 55px rgba(85, 231, 255, 0.14);
}
.test-card.result-mode .gauge {
  max-width: 540px;
}
.test-card.result-mode .speed-number strong {
  font-size: clamp(3rem, 7vw, 5.6rem);
}
.test-card.result-mode .metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.test-card.result-mode .metric-card {
  min-height: 150px;
}
.test-card.result-mode .repeat-hint { display: none; }

.account-section {
  padding-top: 2rem;
}
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
.account-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.052));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.5rem);
}
.account-card.locked {
  opacity: 0.9;
}
.profile-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
.profile-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}
.profile-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: rgba(7,11,23,0.55);
  color: var(--text);
  outline: none;
}
.profile-form input:focus {
  border-color: rgba(85, 231, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(85,231,255,0.1);
}
.profile-status {
  margin-bottom: 0;
  font-size: 0.95rem;
}
.account-card.locked .btn {
  width: 100%;
  margin-top: 0.65rem;
}
.account-card small {
  display: block;
  margin-top: 0.85rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .connection-panel,
  .result-summary,
  .account-grid,
  .test-card.result-mode .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* V5 - idioma, localização opcional, cache anti-429 e fallback de medição */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.88rem;
}

.language-picker select {
  min-width: 160px;
  max-width: 230px;
  color: var(--text);
  background: #11172a;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
  outline: none;
  cursor: pointer;
}

.language-picker select:focus {
  border-color: rgba(85,231,255,0.7);
  box-shadow: 0 0 0 4px rgba(85,231,255,0.1);
}

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(12px);
}
.modal-backdrop[hidden] { display: none; }

.permission-modal {
  position: relative;
  width: min(100%, 460px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(85,231,255,0.22), transparent 18rem),
    linear-gradient(145deg, rgba(17,23,42,0.98), rgba(8,13,28,0.98));
  box-shadow: 0 35px 100px rgba(0,0,0,0.55);
  padding: 1.4rem;
  text-align: center;
}
.permission-modal h2 {
  font-size: clamp(1.6rem, 5vw, 2.35rem);
}
.permission-modal p {
  margin: 0.9rem auto 0;
  max-width: 35rem;
}
.permission-modal small {
  display: block;
  margin-top: 0.9rem;
  color: var(--muted);
}
.permission-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  margin: 0 auto 0.9rem;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 40px rgba(85,231,255,0.33);
  font-size: 1.6rem;
}
.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}
.permission-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}
.permission-actions .btn {
  width: 100%;
  padding: 0.95rem 1.1rem;
}
.btn.primary.soft {
  background: linear-gradient(135deg, rgba(85,231,255,0.68), rgba(124,92,255,0.68));
}
.btn.ghost.danger {
  border-color: rgba(255,107,107,0.35);
  color: #ffd1d1;
}

html[dir="rtl"] body,
html[dir="rtl"] .permission-modal {
  direction: rtl;
}
html[dir="rtl"] .top-nav,
html[dir="rtl"] .header-actions,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .trust-row {
  flex-direction: row-reverse;
}
html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: right;
}

@media (max-width: 900px) {
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .language-picker {
    width: 100%;
    justify-content: space-between;
  }
  .language-picker select {
    flex: 1;
    min-width: 0;
  }
}

/* V6: no resultado, o ponteiro não fica por cima do número. */
.test-card.result-mode .needle,
.test-card.result-mode .needle-center {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* V6: cards de conexão mais legíveis para IP/servidor grandes. */
.connection-panel article strong,
.connection-panel article small {
  overflow-wrap: anywhere;
}
.connection-panel article strong[title],
.connection-panel article small[title] {
  cursor: help;
}
#locationBtn.link-button {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
}

/* V8: teste em duas fases, sem barra inferior, com Upload amarelo queimado */
:root {
  --upload-accent: #d99a24;
  --upload-accent-2: #ffbf4d;
}

.progress-zone {
  display: none !important;
}

.test-card.phase-download .gauge-progress,
.test-card.result-mode .gauge-progress {
  stroke: var(--accent);
  filter: drop-shadow(0 0 12px rgba(85,231,255,0.55));
}

.test-card.phase-upload .gauge-progress {
  stroke: var(--upload-accent);
  filter: drop-shadow(0 0 14px rgba(217,154,36,0.72));
}

.test-card.phase-upload .needle-center {
  fill: var(--upload-accent-2);
}

.test-card.phase-upload .btn.primary {
  background: linear-gradient(135deg, var(--upload-accent-2), var(--upload-accent));
  box-shadow: 0 18px 50px rgba(217,154,36,0.25);
}

.metric-card.active-metric {
  border-color: rgba(85,231,255,0.55);
  box-shadow: 0 0 30px rgba(85,231,255,0.08);
}
.metric-card.upload-active {
  border-color: rgba(217,154,36,0.55);
  box-shadow: 0 0 30px rgba(217,154,36,0.10);
}

.test-card .gauge-card,
.test-card .metrics-grid,
.test-card .speed-layout {
  transition: transform 0.65s ease, max-width 0.65s ease, opacity 0.45s ease, grid-template-columns 0.65s ease;
}

.test-card.result-revealing .gauge-card {
  transform: scale(1.035);
}

.test-card.result-mode .gauge-card {
  animation: revealGaugeResult 0.68s ease both;
}

@keyframes revealGaugeResult {
  0% { transform: scale(0.96); opacity: 0.72; }
  65% { transform: scale(1.025); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 680px) {
  .gauge { padding-bottom: 0.9rem; }
  .speed-number { bottom: -0.35rem; }
  .speed-number strong { font-size: clamp(2.25rem, 14vw, 3.8rem); }
  .speed-number span { display: block; margin-top: 0.1rem; }
}


/* V9: ajuste fino do velocímetro e correção visual do número no PC/celular */
.speed-number {
  bottom: -0.45rem;
}
.speed-number span {
  display: block;
  margin-top: 0.25rem;
}
.gauge-card {
  padding-bottom: 1.65rem;
}
.status-text {
  margin-top: 0.85rem;
}
.test-card.phase-download .speed-number,
.test-card.phase-upload .speed-number,
.test-card.phase-preparing .speed-number {
  bottom: -0.55rem;
}
@media (max-width: 680px) {
  .gauge-card {
    padding-bottom: 1.9rem;
  }
  .gauge { padding-bottom: 1.45rem; }
  .speed-number { bottom: -1.15rem; }
  .speed-number strong { line-height: 0.9; }
  .speed-number span { margin-top: 0.45rem; }
  .status-text { margin-top: 1.15rem; }
}


/* V10: logo oficial, favicon e autorização de localização mais clara */
.brand-icon {
  overflow: hidden;
  background: transparent;
  box-shadow: 0 0 35px rgba(85, 231, 255, 0.34);
}
.brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.privacy-note {
  border-color: rgba(85, 231, 255, 0.34);
  background: linear-gradient(135deg, rgba(85, 231, 255, 0.10), rgba(217,154,36,0.07));
}
.privacy-note strong {
  color: var(--accent);
}
#locationBtn.link-button {
  margin-top: 0.55rem;
  padding: 0.18rem 0;
}
/* Deixa o número e o Mbps mais baixos para não colar no ponteiro/bolinha */
.speed-number {
  bottom: -0.95rem;
}
.speed-number span {
  margin-top: 0.42rem;
}
.gauge-card {
  padding-bottom: 2.15rem;
}
.status-text {
  margin-top: 1.25rem;
}
.test-card.phase-download .speed-number,
.test-card.phase-upload .speed-number,
.test-card.phase-preparing .speed-number {
  bottom: -1.05rem;
}
@media (max-width: 680px) {
  .brand-icon { width: 3.25rem; height: 3.25rem; border-radius: 1rem; }
  .gauge-card { padding-bottom: 2.45rem; }
  .gauge { padding-bottom: 1.9rem; }
  .speed-number { bottom: -1.72rem; }
  .speed-number strong { line-height: 0.9; }
  .speed-number span { margin-top: 0.72rem; }
  .status-text { margin-top: 1.55rem; }
}

/* V11: deixa o número/Mbps ainda mais baixo para não encostar no ponteiro em PC e celular */
.speed-number {
  bottom: -1.25rem;
}
.speed-number span {
  margin-top: 0.62rem;
}
.status-text {
  margin-top: 1.65rem;
}
.test-card.phase-download .speed-number,
.test-card.phase-upload .speed-number,
.test-card.phase-preparing .speed-number {
  bottom: -1.35rem;
}
@media (max-width: 680px) {
  .gauge-card { padding-bottom: 2.95rem; }
  .gauge { padding-bottom: 2.35rem; }
  .speed-number { bottom: -2.15rem; }
  .speed-number span { margin-top: 0.95rem; }
  .status-text { margin-top: 2rem; }
}


/* V13: organização do velocímetro, pico lateral e upload mais robusto */
.metric-card-speed {
  justify-content: flex-start;
}
.metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.metric-head > span {
  color: var(--text);
}
.peak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.peak-pill strong {
  color: var(--text);
  font-size: 0.86rem;
  letter-spacing: -0.03em;
}
.metric-card-download .peak-pill {
  border-color: rgba(85,231,255,0.28);
}
.metric-card-upload .peak-pill {
  border-color: rgba(217,154,36,0.28);
}
.speed-number {
  bottom: -1.8rem;
  z-index: 2;
}
.speed-number strong {
  line-height: 0.86;
}
.speed-number span {
  display: block;
  margin-top: 0.9rem;
}
.gauge-card {
  padding-bottom: 3.25rem;
}
.status-text {
  margin-top: 2rem;
}
.test-card.phase-download .speed-number,
.test-card.phase-upload .speed-number,
.test-card.phase-preparing .speed-number {
  bottom: -1.95rem;
}
@media (max-width: 860px) {
  .metric-head {
    flex-wrap: wrap;
  }
}
@media (max-width: 680px) {
  .gauge-card {
    padding-bottom: 3.45rem;
  }
  .gauge {
    padding-bottom: 2.55rem;
  }
  .speed-number {
    bottom: -2.85rem;
  }
  .speed-number span {
    margin-top: 1.15rem;
  }
  .status-text {
    margin-top: 2.35rem;
  }
  .peak-pill {
    font-size: 0.72rem;
    padding: 0.34rem 0.56rem;
  }
}


/* V14: correção PC - número protegido do ponteiro/bolinha */
.gauge {
  padding-bottom: 3.2rem;
}
.gauge-svg {
  position: relative;
  z-index: 1;
}
.speed-number {
  bottom: -3.35rem;
  z-index: 5;
  min-width: 9.5rem;
  padding: 0.2rem 0.75rem 0.35rem;
  border-radius: 18px;
  background: radial-gradient(circle at center, rgba(7,11,23,0.96) 0%, rgba(7,11,23,0.82) 58%, rgba(7,11,23,0.0) 76%);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.38));
}
.speed-number strong {
  line-height: 0.78;
}
.speed-number span {
  margin-top: 1.25rem;
}
.test-card.phase-download .speed-number,
.test-card.phase-upload .speed-number,
.test-card.phase-preparing .speed-number {
  bottom: -3.45rem;
}
.gauge-card {
  padding-bottom: 4.4rem;
}
.status-text {
  margin-top: 2.8rem;
}
@media (min-width: 681px) {
  .speed-number strong {
    font-size: clamp(2.25rem, 4.9vw, 4.15rem);
  }
}
@media (max-width: 680px) {
  .gauge {
    padding-bottom: 3.45rem;
  }
  .speed-number {
    bottom: -3.25rem;
    min-width: 8.5rem;
  }
  .test-card.phase-download .speed-number,
  .test-card.phase-upload .speed-number,
  .test-card.phase-preparing .speed-number {
    bottom: -3.35rem;
  }
  .gauge-card {
    padding-bottom: 4.3rem;
  }
  .status-text {
    margin-top: 2.75rem;
  }
}


/* V15: ajuste final PC para afastar número/bolinha e corrigir leitura */
@media (min-width: 681px) {
  .gauge {
    padding-bottom: 3.75rem;
  }
  .speed-number {
    bottom: -3.95rem;
    min-width: 10.2rem;
  }
  .test-card.phase-download .speed-number,
  .test-card.phase-upload .speed-number,
  .test-card.phase-preparing .speed-number {
    bottom: -4.05rem;
  }
  .speed-number span {
    margin-top: 1.45rem;
  }
  .gauge-card {
    padding-bottom: 5rem;
  }
  .status-text {
    margin-top: 3.15rem;
  }
}


/* V21: páginas institucionais, blog e blindagem Anti-CLS para anúncios */
.ad-shell {
  margin: 0 clamp(1rem, 4vw, 4rem);
  border: 1px dashed rgba(255,255,255,0.22);
  border-radius: 22px;
  background: rgba(255,255,255,0.045);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  overflow: hidden;
}
.ad-shell.top-ad {
  min-height: 100px;
  width: min(100%, 728px);
  margin-left: auto;
  margin-right: auto;
}
.ad-shell.mid-ad {
  min-height: 250px;
}
@media (min-width: 768px) {
  .ad-shell.top-ad {
    width: 728px;
  }
}

.page-hero {
  padding: clamp(2.6rem, 7vw, 6.5rem) clamp(1rem, 4vw, 4rem) clamp(1.5rem, 4vw, 3rem);
}
.page-hero-inner {
  max-width: 980px;
}
.page-hero h1 {
  max-width: 980px;
}
.page-hero p {
  max-width: 780px;
  font-size: clamp(1rem, 2vw, 1.18rem);
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.2rem;
  padding: 0 clamp(1rem, 4vw, 4rem) clamp(2.5rem, 6vw, 5rem);
}
.content-card, .side-card, .article-card, .blog-list-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.045));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.content-card, .side-card {
  padding: clamp(1.1rem, 3vw, 2rem);
}
.content-card h2, .content-card h3 {
  margin-top: 1.4rem;
}
.content-card h2:first-child, .content-card h3:first-child {
  margin-top: 0;
}
.content-card ul, .content-card ol {
  color: var(--muted);
  line-height: 1.75;
  padding-left: 1.2rem;
}
.side-card {
  position: sticky;
  top: 92px;
  align-self: start;
}
.side-card a, .content-card a, .article-card a, .blog-list-card a {
  color: var(--accent);
}
.blog-grid {
  padding: 0 clamp(1rem, 4vw, 4rem) clamp(2.5rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.article-card {
  padding: 1.2rem;
}
.article-card h2 {
  font-size: 1.35rem;
  margin-top: 0.4rem;
}
.article-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}
.article-page {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 2rem);
}
.article-body {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.045));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2.2rem);
}
.article-body h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
}
.article-body h2 {
  margin-top: 2rem;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}
.article-body p, .article-body li {
  color: var(--muted);
  line-height: 1.75;
}
.article-body ul, .article-body ol {
  padding-left: 1.2rem;
}
.article-cta {
  margin-top: 2rem;
  border: 1px solid rgba(85,231,255,0.28);
  border-radius: 22px;
  padding: 1rem;
  background: rgba(85,231,255,0.07);
}
.contact-box {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}
.contact-row {
  border: 1px solid var(--line);
  background: rgba(7,11,23,0.42);
  border-radius: 18px;
  padding: 1rem;
}
@media (max-width: 980px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .side-card {
    position: static;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
}


/* V21.1: assinatura autoral discreta */
.creator-signature {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.45rem;
}
.author-line {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

/* V21.4: formulário seguro de contato */
.contact-form {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.6rem;
}
.contact-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 800;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7,11,23,0.62);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  outline: none;
}
.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(85,231,255,0.62);
  box-shadow: 0 0 0 4px rgba(85,231,255,0.10);
}
.form-status {
  margin: 0;
  min-height: 1.4rem;
}
.form-status[data-state="success"] { color: #77f7b0; }
.form-status[data-state="error"] { color: #ff9c9c; }
.form-status[data-state="loading"] { color: var(--accent); }

/* V21.6: Painel admin privado */
.admin-page {
  min-height: 100vh;
}
.admin-dashboard {
  padding: 0 clamp(1rem, 4vw, 4rem) clamp(2.5rem, 6vw, 5rem);
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-metrics {
  margin-bottom: 1rem;
}
.admin-section {
  margin-top: 1rem;
}
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}
.admin-table-wrap th,
.admin-table-wrap td {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 0.75rem;
  text-align: left;
}
.admin-table-wrap th {
  color: var(--text);
}
.admin-list {
  display: grid;
  gap: 0.8rem;
}
.admin-message {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(7,11,23,0.42);
}
.admin-message p {
  margin: 0.45rem 0;
}
.admin-message small {
  color: var(--muted);
}
.admin-message pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  background: rgba(0,0,0,0.2);
  border-radius: 14px;
  padding: 0.75rem;
  max-height: 240px;
  overflow: auto;
}
.admin-logout {
  font-size: 0.9rem;
}

/* V21.7: olhinho para senha/código no admin */
.password-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.45rem;
}
.password-wrap input {
  min-width: 0;
}
.password-toggle {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 0 0.85rem;
  cursor: pointer;
  font-size: 1rem;
}
.password-toggle:hover {
  background: rgba(255,255,255,0.14);
}

/* V21.8: navegador confiável para reduzir envio de códigos por e-mail */
.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 0.65rem !important;
  color: var(--muted);
  font-weight: 700 !important;
  line-height: 1.45;
}
.check-row input {
  width: auto !important;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

/* V21.10: CAPTCHA/Turnstile no admin */
.captcha-zone {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem;
  background: rgba(255,255,255,0.045);
}
.captcha-zone p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-weight: 800;
}

/* V21.13: avisos do painel admin quando Supabase negar alguma tabela */
.admin-warnings {
  margin: 1rem clamp(1rem, 4vw, 4rem);
  border: 1px solid rgba(255, 201, 74, 0.35);
  border-radius: 20px;
  background: rgba(255, 201, 74, 0.08);
  color: var(--text);
  padding: 1rem;
}
.admin-warnings strong {
  color: #ffd36b;
}
.admin-warnings p {
  color: var(--muted);
}
.admin-warnings pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

/* V21.15: hidden forte para impedir que formulário de código continue visível */
[hidden] {
  display: none !important;
}

/* V23: Central de Guias */
.article-body-wide {
  max-width: 980px;
}
.guide-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0 1.6rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.045);
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.guide-table th,
.guide-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.guide-table th {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
.guide-table td {
  color: var(--muted);
}
.related-guides {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.related-grid a {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  border-radius: 16px;
  padding: 0.9rem;
  color: var(--text);
  font-weight: 800;
}
.related-grid a:hover {
  border-color: rgba(85,231,255,0.55);
  box-shadow: 0 0 0 4px rgba(85,231,255,0.08);
}
.guide-hub-cta {
  max-width: 860px;
  margin: 0 auto;
}
.center-action {
  text-align: center;
  margin-top: 1.4rem;
}
.compact-guide-grid .article-card h3 {
  margin-bottom: 0.55rem;
}

.editorial-section .section-head {
  max-width: 980px;
}
