/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --ink: #10231C;
  --ink-soft: #4B5D56;
  --border: #E1E8E5;
  --accent: #0E6E5C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4F3EF;
  --good: #1C8A5A;
  --good-bg: #E7F6ED;
  --warn: #B77C11;
  --warn-bg: #FBF1DD;
  --bad: #C23B3B;
  --bad-bg: #FBEAEA;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px -16px rgba(16, 35, 28, 0.22);
  --sans: "Inter", system-ui, sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1512;
    --surface: #16211C;
    --ink: #EAF3EF;
    --ink-soft: #A7B8B0;
    --border: #26332C;
    --accent: #4FD3AD;
    --accent-ink: #06231A;
    --accent-soft: #17332A;
    --good: #57C98A;
    --good-bg: #123322;
    --warn: #E3B04E;
    --warn-bg: #362A12;
    --bad: #EF6B6B;
    --bad-bg: #3A1B1B;
    --shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
/* Any element styled with an explicit `display` elsewhere in this file (e.g.
   .results is display:grid, .error-box is display:flex) ties in specificity
   with the UA stylesheet's [hidden]{display:none} and would otherwise win
   because it's declared later — force hidden to always mean hidden. */
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; font-family: var(--display); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Header / footer
   ============================================================= */
.site-header { padding: 18px 0; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--accent); }
.header-nav { display: flex; gap: 20px; font-size: 0.92rem; font-weight: 500; color: var(--ink-soft); }
.header-nav a:hover { color: var(--accent); }
@media (max-width: 539px) { .header-nav a:first-child { display: none; } }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; margin-top: 12px; color: var(--ink-soft); font-size: 0.88rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.footer-inner nav { display: flex; gap: 16px; }
.footer-inner nav a:hover { color: var(--accent); }

/* =============================================================
   5. Hero + tool card
   ============================================================= */
.hero { padding: 40px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 12px; }
.hero-sub { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 28px; font-size: 1.05rem; }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.gauge-wrap { position: relative; width: 100%; max-width: 320px; }
.gauge { width: 100%; height: auto; overflow: visible; }
.gauge-track { fill: none; stroke: var(--border); stroke-width: 12; stroke-linecap: round; }
.gauge-value {
  fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round;
  transition: stroke 0.3s var(--ease-out);
}
.gauge-needle { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; transform-origin: 100px 108px; }
.gauge-pivot { fill: var(--ink); }
.gauge-readout {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.gauge-number { font-family: var(--display); font-size: 2.1rem; font-weight: 800; line-height: 1; }
.gauge-unit { font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; }
.gauge-phase { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-top: 6px; min-height: 1.2em; }

.btn-start {
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 1.05rem;
  padding: 14px 40px; border-radius: 999px;
  transition: transform 0.2s var(--ease-out), opacity 0.2s;
}
.btn-start:hover { transform: translateY(-2px); }
.btn-start:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn-retry {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 0.95rem;
  padding: 10px 22px; border-radius: 999px;
}

.results {
  width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.result-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.result-label { font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }
.result-value { font-family: var(--display); font-size: 1.3rem; font-weight: 800; }
.result-value small { font-size: 0.7rem; font-weight: 600; color: var(--ink-soft); }

.error-box { text-align: center; color: var(--bad); display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* =============================================================
   6. Diagnostic
   ============================================================= */
.diagnostic { text-align: left; margin-top: 28px; }
.diagnostic h2 { font-size: 1.3rem; margin-bottom: 14px; }
.diagnostic h3 { font-size: 1.05rem; margin: 20px 0 10px; }

.diag-tips { display: flex; flex-direction: column; gap: 10px; }
.diag-tip {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.diag-tip.level-critico { border-left-color: var(--bad); }
.diag-tip.level-mejorable { border-left-color: var(--warn); }
.diag-tip.level-bueno { border-left-color: var(--good); }
.diag-tip .icon { font-size: 1.3rem; line-height: 1; }
.diag-tip .body strong { display: block; margin-bottom: 3px; font-size: 0.98rem; }
.diag-tip .body p { color: var(--ink-soft); font-size: 0.92rem; }

.diag-checklist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.diag-checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.94rem; padding: 8px 10px; border-radius: var(--radius-sm); }
.diag-checklist li.ok { background: var(--good-bg); color: var(--good); }
.diag-checklist li.warn { background: var(--warn-bg); color: var(--warn); }
.diag-checklist li span.label { color: var(--ink); font-weight: 500; }
.diag-checklist li .mark { font-weight: 700; }

.privacy-badge { margin-top: 22px; color: var(--ink-soft); font-size: 0.88rem; }
.honest-limits { margin-top: 8px; color: var(--ink-soft); font-size: 0.82rem; max-width: 56ch; margin-left: auto; margin-right: auto; }

/* =============================================================
   7. Ad slots
   ============================================================= */
.ad-slot {
  max-width: 760px; margin: 32px auto; min-height: 90px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 0.78rem; letter-spacing: 0.08em; font-weight: 700;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.ad-slot--leaderboard { max-width: 970px; }
.ad-slot--incontent { min-height: 250px; }

/* =============================================================
   8. Content sections
   ============================================================= */
.content { padding: 44px 0; }
.content h2 { font-size: 1.5rem; margin-bottom: 18px; }

.steps { list-style: none; display: grid; gap: 14px; margin-bottom: 8px; }
.steps li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.steps li strong { display: block; color: var(--accent); font-size: 1.02rem; margin-bottom: 4px; }
.steps li span { color: var(--ink-soft); font-size: 0.95rem; }

.seo-text { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; color: var(--ink-soft); }
.seo-text h2 { color: var(--ink); font-size: 1.25rem; }
.seo-text strong { color: var(--ink); }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-list details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.faq-list summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; flex-shrink: 0; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { color: var(--ink-soft); margin-top: 10px; font-size: 0.95rem; }

/* =============================================================
   9. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .results { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 720px) {
  .tool-card { padding: 40px 40px 34px; }
}

/* =============================================================
   10. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .btn-start:hover { transform: none; }
}
