/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #0B0F1A;
  --surface: #121826;
  --surface-2: #1A2233;
  --border: #212A3D;
  --border-soft: #2A3450;

  --teal: #2DD4BF;
  --teal-light: #5EEAD4;
  --purple: #A78BFA;
  --purple-light: #C4B5FD;
  --cyan: #22D3EE;
  --amber: #FDE68A;

  --text: #F1F5F9;
  --text-mute: #94A3B8;
  --text-dim: #64748B;

  --ok: #34D399;
  --warn: #FBBF24;
  --bad: #FB7185;

  --whatsapp: #25D366;

  --grad-brand: linear-gradient(120deg, var(--teal) 0%, var(--cyan) 55%, var(--purple) 100%);

  --serif: "Manrope", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 60px -30px rgba(0,0,0,.6);
}

@property --grad-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 120deg;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 800; text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--teal); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--surface); color: var(--text);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: min(1160px, 92%); margin-inline: auto; }
.container-narrow { width: min(760px, 92%); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section { padding: clamp(48px, 8vw, 96px) 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal-light);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--text-mute); }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background .3s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-brand); color: #051012;
  box-shadow: 0 10px 30px -10px rgba(45,212,191,.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(45,212,191,.55); }
.btn-ghost {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-soft);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-light); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: .55rem 1.1rem; font-size: .85rem; }
.btn-danger { background: rgba(251,113,133,.12); color: #fda4af; border: 1px solid rgba(251,113,133,.35); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
}
.card-soft { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text);
}
.pill-credits { color: var(--teal-light); border-color: rgba(45,212,191,.35); background: rgba(45,212,191,.08); }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .85rem; font-weight: 700; color: var(--text-mute); }
.field input, .field textarea, .field select {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: .8rem 1rem; color: var(--text); transition: border-color .2s;
}
.field select { color-scheme: dark; }
.field select option { background: var(--surface-2); color: var(--text); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--teal); outline: none; }
.field textarea { min-height: 140px; resize: vertical; font-family: var(--sans); }
.field-hint { font-size: .78rem; color: var(--text-dim); }
.field-error { font-size: .8rem; color: var(--bad); min-height: 1em; }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: .6rem; max-width: min(360px, 90vw); }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; font-size: .88rem; box-shadow: var(--shadow-card);
  animation: toast-in .3s var(--ease-out);
}
.toast.ok { border-color: rgba(52,211,153,.4); }
.toast.error { border-color: rgba(251,113,133,.4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.icon { width: 1.1em; height: 1.1em; flex: none; }

/* =============================================================
   6. Sections — shared shell (nav / footer)
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,15,26,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--serif); font-weight: 800; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-suffix { color: var(--text-dim); font-weight: 600; font-size: .78rem; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; font-size: .92rem; font-weight: 600; color: var(--text-mute); }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: .8rem; }

.footer { border-top: 1px solid var(--border); padding: 2.6rem 0; color: var(--text-dim); font-size: .88rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text-mute); }
.footer-social { display: flex; gap: .9rem; align-items: center; }
.footer-social a { display: inline-flex; color: var(--text-dim); }
.footer-social a:hover { color: var(--teal-light); }
.footer-social svg { width: 18px; height: 18px; }

/* App-shell top bar (calm, no marketing) */
.appbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.appbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.appbar-right { display: flex; align-items: center; gap: .8rem; }
.app-main { padding: clamp(24px, 4vw, 48px) 0 80px; min-height: 70vh; }

/* =============================================================
   7. Hero / landing sections
   ============================================================= */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px); position: relative; overflow: clip; }
.hero-glow {
  position: absolute; inset: -20% -10% auto -10%; height: 620px; z-index: -1;
  background: radial-gradient(60% 60% at 30% 20%, rgba(45,212,191,.22), transparent 70%),
              radial-gradient(50% 50% at 80% 10%, rgba(167,139,250,.18), transparent 70%);
  filter: blur(20px);
}
.hero-grid { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: 1fr; align-items: center; }
.hero-copy { max-width: 640px; }
.hero-copy h1 { margin: 1rem 0 1.1rem; }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }
.hero-trust { display: flex; gap: 1.4rem; margin-top: 1.6rem; color: var(--text-dim); font-size: .85rem; flex-wrap: wrap; }
.hero-trust span { display: flex; align-items: center; gap: .4rem; }

.demo-panel {
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  padding: 1.4rem; box-shadow: var(--shadow-card);
}
.demo-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.demo-url { font-family: ui-monospace, monospace; font-size: .82rem; color: var(--text-mute); background: var(--bg); border: 1px solid var(--border-soft); border-radius: 8px; padding: .55rem .8rem; }
.score-ring-wrap { display: flex; align-items: center; gap: 1.2rem; padding: 1rem 0; }
.score-ring { width: 96px; height: 96px; flex: none; }
.score-num { font-family: var(--serif); font-size: 2.1rem; font-weight: 800; }
.demo-cats { display: flex; flex-direction: column; gap: .55rem; margin-top: .6rem; }
.demo-cat-row { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--text-mute); }
.demo-cat-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.demo-cat-dot.ok { background: var(--ok); }
.demo-cat-dot.warn { background: var(--warn); }
.demo-cat-dot.bad { background: var(--bad); }

.logos-row { display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; align-items: center; justify-content: center; margin-top: 2.4rem; opacity: .8; }
.logos-row span { font-size: .8rem; color: var(--text-dim); font-weight: 700; letter-spacing: .04em; }

.section-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head .eyebrow { margin-bottom: .8rem; }

.grid-3 { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.feature-card { display: flex; flex-direction: column; gap: .8rem; }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--teal-light);
}
.feature-card h3 { margin-top: .2rem; }
.feature-card p { color: var(--text-mute); font-size: .93rem; }

.steps { counter-reset: step; display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.step { position: relative; padding-left: 3rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 10px;
  background: var(--grad-brand); color: #051012; font-weight: 800; display: grid; place-items: center;
  font-family: var(--serif);
}
.step h3 { margin-bottom: .3rem; }
.step p { color: var(--text-mute); font-size: .92rem; }

/* Pricing */
.pricing-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; gap: 1.2rem; position: relative; }
.plan-card.featured { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), var(--shadow-card); }
.plan-tag {
  position: absolute; top: -13px; left: 1.6rem; background: var(--grad-brand); color: #051012;
  font-size: .72rem; font-weight: 800; padding: .3rem .8rem; border-radius: 999px;
}
.plan-name { font-size: 1rem; color: var(--text-mute); font-weight: 700; }
.plan-price { display: flex; align-items: baseline; gap: .4rem; font-family: var(--serif); }
.plan-price .num { font-size: 2.2rem; font-weight: 800; }
.plan-price .period { color: var(--text-dim); font-size: .82rem; }
.plan-credits { color: var(--teal-light); font-weight: 700; font-size: .9rem; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; font-size: .88rem; color: var(--text-mute); flex: 1; }
.plan-list li { display: flex; gap: .55rem; align-items: flex-start; }
.plan-list svg { flex: none; margin-top: .15rem; color: var(--teal); }

.faq-list { display: flex; flex-direction: column; gap: .8rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: clip; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.3rem; text-align: left; font-weight: 700; font-size: .96rem;
}
.faq-q svg { transition: transform .25s var(--ease-out); flex: none; color: var(--text-mute); }
.faq-item[data-open="true"] .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease-out); }
.faq-a-inner { padding: 0 1.3rem 1.1rem; color: var(--text-mute); font-size: .9rem; }

.final-cta { text-align: center; padding: clamp(48px, 8vw, 88px) 0; }
.final-cta h2 { margin-bottom: 1rem; }

/* =============================================================
   8. Auth modal
   ============================================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,8,14,.7); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 1.2rem; z-index: 500;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(22px, 4vw, 32px);
  box-shadow: var(--shadow-card); animation: modal-in .25s var(--ease-out);
}
.modal-lg { width: min(560px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.modal-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--text-mute); }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-tabs { display: flex; gap: .4rem; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 999px; padding: .3rem; margin-bottom: 1.3rem; }
.modal-tab { flex: 1; padding: .55rem; border-radius: 999px; font-weight: 700; font-size: .85rem; text-align: center; color: var(--text-mute); }
.modal-tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }

/* =============================================================
   9. App tool (dropzone / states)
   ============================================================= */
.tool-shell { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.tool-card { display: flex; flex-direction: column; gap: 1.1rem; }
.tool-tabs { display: flex; gap: .5rem; }
.tool-tab {
  padding: .55rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-mute);
}
.tool-tab[aria-selected="true"] { background: rgba(45,212,191,.12); border-color: var(--teal); color: var(--teal-light); }
.tool-panel[hidden] { display: none; }
.cost-line { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--text-mute); }
.cost-line strong { color: var(--teal-light); }

.tool[data-state] .tool-idle,
.tool[data-state] .tool-working,
.tool[data-state] .tool-done,
.tool[data-state] .tool-error { display: none; }
.tool[data-state="idle"] .tool-idle,
.tool[data-state="working"] .tool-working,
.tool[data-state="done"] .tool-done,
.tool[data-state="error"] .tool-error { display: block; }

.working-box { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.4rem 1rem; text-align: center; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--border-soft); border-top-color: var(--teal); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.report-head { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between; margin-bottom: 1.6rem; }
.report-score { display: flex; align-items: center; gap: 1.2rem; }
.report-cats { display: grid; gap: .8rem; grid-template-columns: 1fr; margin-bottom: 1.6rem; }
.cat-row { display: flex; gap: .9rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.cat-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: .35rem; flex: none; }
.cat-dot.ok { background: var(--ok); box-shadow: 0 0 10px rgba(52,211,153,.5); }
.cat-dot.warn { background: var(--warn); box-shadow: 0 0 10px rgba(251,191,36,.5); }
.cat-dot.bad { background: var(--bad); box-shadow: 0 0 10px rgba(251,113,133,.5); }
.cat-dot.na { background: var(--text-dim); }
.cat-body h4 { font-family: var(--sans); font-size: .95rem; font-weight: 800; margin-bottom: .3rem; }
.cat-body p { font-size: .87rem; color: var(--text-mute); }
.cat-body .cat-reco { margin-top: .5rem; font-size: .85rem; color: var(--teal-light); }

.opp-list { display: flex; flex-direction: column; gap: .7rem; }
.opp-item { display: flex; gap: .8rem; padding: 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.opp-impact { font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; flex: none; height: fit-content; }
.opp-impact.alto { background: rgba(251,113,133,.14); color: #fda4af; }
.opp-impact.medio { background: rgba(251,191,36,.14); color: #fcd34d; }
.opp-impact.bajo { background: rgba(148,163,184,.14); color: #cbd5e1; }

/* Regla general: el atributo hidden SIEMPRE gana. Cualquier clase con display propio (.btn, .opp-item, .card…) lo anulaba y dejaba a la vista elementos «ocultos». */
[hidden] { display: none !important; }

/* Acceso de rastreadores de IA (informativo) */
.crawl-card { margin-bottom: 1.6rem; }
.crawl-intro, .crawl-robots { font-size: .87rem; color: var(--text-mute); margin-bottom: .5rem; overflow-wrap: anywhere; }
.crawl-robots { color: var(--text-dim); font-size: .82rem; }
.crawl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); margin: .6rem 0 1rem; }
.crawl-leyenda, .crawl-alcance { font-size: .8rem; color: var(--text-dim); margin: 0 0 .25rem; line-height: 1.5; }
.crawl-wrap + .crawl-leyenda, .crawl-wrap + .crawl-alcance { margin-top: -.5rem; }
.crawl-alcance { margin-bottom: 1rem; }
.crawl-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.crawl-table th { text-align: left; color: var(--text-dim); font-weight: 700; padding: .65rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.crawl-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); color: var(--text-mute); vertical-align: top; }
.crawl-table tr:last-child td { border-bottom: 0; }
.crawl-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; color: var(--text); overflow-wrap: anywhere; }
.crawl-table td:first-child code { white-space: nowrap; }
.crawl-estado { display: inline-block; white-space: nowrap; font-weight: 800; font-size: .8rem; line-height: 1.3; padding: .15rem .55rem; border-radius: 8px; border: 1px solid var(--border); }
.crawl-estado--permitido { color: var(--ok); border-color: rgba(52,211,153,.45); background: rgba(52,211,153,.08); }
.crawl-estado--sin_regla, .crawl-estado--sin_robots { color: var(--text-mute); border-color: var(--border); background: rgba(148,163,184,.08); }
.crawl-estado--bloqueado { color: #fda4af; border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.1); }
.crawl-estado--no_verificado { color: #fcd34d; border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.1); }
.crawl-regla { display: inline-block; margin-top: .3rem; color: var(--text-dim); }
.crawl-inicio { display: inline-block; margin-top: .3rem; color: var(--text-dim); font-size: .78rem; overflow-wrap: anywhere; }
.crawl-opp { margin-bottom: 1rem; }
.crawl-opp-titulo { font-weight: 700; font-size: .92rem; }
.crawl-opp-detalle { font-size: .85rem; color: var(--text-mute); margin-top: .2rem; overflow-wrap: anywhere; }
.crawl-nota { font-size: .8rem; color: var(--text-dim); margin: .4rem 0 0; line-height: 1.55; }
@media (max-width: 640px) {
  .crawl-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .crawl-table, .crawl-table tbody, .crawl-table tr, .crawl-table td { display: block; width: 100%; }
  .crawl-table tr { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .crawl-table tr:last-child { border-bottom: 0; }
  .crawl-table td { border: 0; padding: .2rem .8rem; }
  .crawl-table td::before { content: attr(data-label) ": "; color: var(--text-dim); font-weight: 700; }
}

.disclaimer-box {
  display: flex; gap: .7rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.3); color: var(--purple-light);
  font-size: .85rem; margin-top: 1.4rem;
}

/* =============================================================
   10. Account page
   ============================================================= */
.account-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.plan-current { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.credits-bar-wrap { margin-top: .9rem; }
.credits-bar { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-soft); overflow: hidden; }
.credits-bar-fill { height: 100%; background: var(--grad-brand); border-radius: 999px; transition: width .5s var(--ease-out); }
.history-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history-table th { text-align: left; color: var(--text-dim); font-weight: 700; padding: .6rem .4rem; border-bottom: 1px solid var(--border); }
.history-table td { padding: .7rem .4rem; border-bottom: 1px solid var(--border); color: var(--text-mute); }
.history-empty { color: var(--text-dim); font-size: .88rem; padding: 1rem 0; }

/* =============================================================
   11. Checkout modal
   ============================================================= */
.checkout-plan { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-soft); margin-bottom: 1rem; }

/* =============================================================
   12. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .nav-links { display: flex; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 719px) {
  .nav-links { display: none; }
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
  .report-cats { grid-template-columns: 1fr 1fr; }
  .account-grid { grid-template-columns: 1.3fr .9fr; }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px) {
  .hero-copy h1 { font-size: 3.6rem; }
}

/* =============================================================
   13. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .modal, .toast { animation: none; }
  .spinner { animation-duration: 1.6s; }
}

/* =============================================================
   14. Print (report export)
   ============================================================= */
@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #F8FAFC;
    --border: #D8DEE9;
    --border-soft: #D8DEE9;
    --text: #0B1220;
    --text-mute: #3F4A5C;
    --text-dim: #5B6472;
    --teal: #0F766E;
    --teal-light: #0F766E;
    --purple: #6D28D9;
    --purple-light: #5B21B6;
  }

  html, body { background: #fff; color: var(--text); }

  .appbar, .footer, .nav, .no-print, .skip-link, .cookie-aviso { display: none !important; }

  a { color: var(--text); text-decoration: none; }
  .card, .cat-row, .opp-item { background: #fff; border-color: var(--border); box-shadow: none; }
  .crawl-wrap { background: #fff; overflow: visible; }
  /* La tarjeta NO se marca como «no partir»: puede cortarse entre filas. Cada fila va entera y el encabezado de la tabla se repite en la página siguiente. */
  .crawl-table tr, .crawl-opp, .crawl-nota, .crawl-leyenda, .crawl-alcance { break-inside: avoid; page-break-inside: avoid; }
  .crawl-intro, .crawl-robots { break-after: avoid; page-break-after: avoid; }
  .crawl-wrap { break-after: avoid; page-break-after: avoid; }                       /* solo la última fila va encadenada con la leyenda «Sin regla: …»… */
  .crawl-leyenda { break-before: avoid; page-break-before: avoid; }                  /* …y la nota «Informativo» queda libre para fluir (sin hueco en la tabla) */
  .crawl-table thead { display: table-header-group; position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .crawl-table { display: table; }
  .crawl-table tbody { display: table-row-group; }
  .crawl-table tr { display: table-row; padding: 0; }
  .crawl-table td { display: table-cell; width: auto; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
  .crawl-table td::before { content: none; }
  .crawl-estado { background: #fff !important; color: var(--text) !important; border: 1px solid #5B6472; }
  .crawl-estado--bloqueado { border-width: 2px; }
  h1, h2, h3, h4 { letter-spacing: normal; word-spacing: .1em; }   /* el espacio del tipo de los títulos mide ≈ 0,2 em (el del texto ≈ 0,3 em) */
  /* Los fondos (puntos de estado, pastillas ALTO/INFORMATIVO, cajas gris y lila) se imprimen aunque «Gráficos de fondo» esté desactivado en el cuadro de impresión. */
  *, *::before, *::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Firefox no respeta «no partir» dentro de contenedores flex/grid ni con overflow en el body: solo al imprimir se muestran como bloque (en Chrome no cambia nada). */
  .tool-shell, .tool-card { display: block; }
  html, body { overflow: visible; }
  .app-main { padding-bottom: 0; min-height: 0; }   /* sin el relleno de 80 px ni el alto mínimo de pantalla: provocaban una última página en blanco */
  .card.tool-card { border: none; padding: 0; }
  .container, .container-narrow { max-width: 100%; margin: 0; padding: 0; }

  .report-cats { grid-template-columns: 1fr !important; }

  .report-head, .cat-row, .opp-item, .disclaimer-box, [data-modo-nota], [data-recorte-nota], [data-alcance-nota] {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h1, h3 { break-after: avoid; page-break-after: avoid; }

  .opp-impact.alto  { background: #FEE2E2 !important; color: #B91C1C !important; }
  .opp-impact.medio { background: #FEF3C7 !important; color: #92400E !important; }
  .opp-impact.bajo  { background: #E2E8F0 !important; color: #334155 !important; }
}

/* =============================================================
   15. Aviso de cookies
   ============================================================= */
.cookie-aviso {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 300;
  width: min(720px, calc(100vw - 32px));
  display: flex; align-items: center; gap: .8rem 1.2rem; flex-wrap: wrap;
  padding: 1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .55);
  animation: cookie-in .34s var(--ease-out) both;
}
.cookie-aviso--out { animation: cookie-out .24s ease-in both; }
@keyframes cookie-in  { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cookie-out { to { opacity: 0; transform: translate(-50%, 16px); } }
.cookie-aviso__txt { flex: 1 1 320px; margin: 0; font-size: .84rem; line-height: 1.6; color: var(--text-mute); }
.cookie-aviso__txt a { color: var(--teal-light); text-decoration: underline; }
.cookie-aviso__acciones { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.cookie-aviso__cats { flex-basis: 100%; display: flex; flex-direction: column; gap: .6rem; margin-top: .2rem; }
.cookie-aviso__cat { display: flex; gap: .5rem; font-size: .82rem; color: var(--text-mute); line-height: 1.5; }
@media (max-width: 560px) {
  .cookie-aviso { bottom: 0; width: 100vw; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .cookie-aviso__acciones { margin-left: 0; width: 100%; }
  .cookie-aviso__acciones .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-aviso, .cookie-aviso--out { animation: none; }
}
/* Encabezado en pantallas muy estrechas (≤400 px): el botón «Probar gratis» ya no se sale del ancho. */
@media (max-width: 400px) {
  .nav-inner { gap: .5rem; }
  .nav-cta { gap: .4rem; }
  .nav-cta .btn-sm { padding: .5rem .55rem; font-size: .78rem; }
}
/* =============================================================
   Enviar comentarios (botón flotante + ventana)
   ============================================================= */
.fab-comentarios {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.05rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: .85rem; line-height: 1;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.fab-comentarios:hover { border-color: var(--teal); transform: translateY(-1px); }
.fab-comentarios .icon { width: 18px; height: 18px; flex: none; }
.con-comentarios .footer { padding-bottom: 5.5rem; }   /* el botón flotante no tapa los enlaces del pie */
.com-modal { max-height: calc(100vh - 2.4rem); overflow-y: auto; }
.com-aviso { margin: 0 0 1rem; padding: .55rem .8rem; font-size: .85rem; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--teal); border-radius: var(--radius-sm); }
.com-pie { display: flex; justify-content: space-between; gap: .6rem; }
.com-contador--max { color: var(--bad); }
.com-check { margin: 0 0 1rem; display: flex; flex-direction: column; gap: .3rem; }
.com-check label { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; font-weight: 600; color: var(--text-mute); cursor: pointer; }
.com-check input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin-top: .1rem; accent-color: var(--teal); }
.com-check input[type="checkbox"]:disabled + span { opacity: .55; }
.com-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* campo trampa para bots: fuera de pantalla, no oculto */
.com-detalle { margin: 0 0 1rem; font-size: .82rem; color: var(--text-mute); }
.com-detalle summary { cursor: pointer; font-weight: 700; color: var(--text); }
.com-detalle ul { margin: .6rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; line-height: 1.5; }
#com-estado { margin: 0 0 .9rem; font-size: .88rem; padding: .6rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-mute); }
#com-estado[data-tipo="error"] { color: var(--bad); border-color: var(--bad); }
#com-estado[data-tipo="ok"] { color: var(--teal-light); }
@media (max-width: 560px) {
  .fab-comentarios { right: 12px; bottom: 12px; padding: .65rem .9rem; }
  .com-modal { padding: 1.1rem; }
}
/* Marca (cambio de nombre «Conectamos8 Auditoría IA»): el nombre es más largo que el anterior. En pantallas angostas la cabecera muestra solo «Conectamos8»,
   con logo, créditos y botones algo más compactos; en pantallas más anchas vuelve el sufijo «Auditoría IA». Medido de 320 a 768 px: no desborda más que antes. */
@media (max-width: 430px) {
  .brand-suffix { display: none; }
  .brand { font-size: .9rem; gap: .4rem; }
  .brand-mark { width: 26px; height: 26px; }
  .appbar-right { gap: .4rem; }
  .appbar-right .pill-credits { padding: .3rem .5rem; font-size: .72rem; }
  .appbar-right .btn-sm { padding: .45rem .6rem; font-size: .78rem; }
}
/* En pantallas de 340 px o menos: solo el logo; el nombre queda para lectores de pantalla. */
@media (max-width: 340px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
