/* ═══════════════════════════════════════════════════════════
   Ahá Herramientas Digitales · Auditoría SEO + GEO (formulario, informe y PDF)
   ═══════════════════════════════════════════════════════════ */

/* ── Formulario ── */
.aud-card { max-width: 820px; }
.aud-form { gap: 14px; }
.aud-form-campos { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.aud-form input[type=text], .aud-form input[type=email] { min-height: 48px; font-size: 1rem; }
.aud-form input[aria-invalid=true] { border-color: var(--err); }
.aud-form .btn-lg { align-self: flex-start; }
.aud-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.aud-legal { margin: 0; }
.aud-aviso { margin: 0 0 16px; }

.aud-analizando { padding: 6px 2px; }
.aud-analizando-tit { font-weight: 800; font-size: 1.1rem; color: var(--navy); margin-bottom: 10px; }
.aud-barra { height: 10px; border-radius: 999px; background: var(--blue-50); overflow: hidden; }
.aud-barra > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--orange), #FFAE4D); transition: width .4s ease; }
.aud-pasos { list-style: none; margin: 16px 0 10px; padding: 0; display: grid; gap: 6px; }
.aud-pasos li { position: relative; padding-left: 28px; color: var(--muted); font-size: .92rem; }
.aud-pasos li::before { content: ''; position: absolute; left: 4px; top: .45em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.aud-pasos li.actual { color: var(--ink); font-weight: 700; }
.aud-pasos li.actual::before { border-color: var(--orange); border-top-color: transparent; animation: spin .8s linear infinite; }
.aud-pasos li.hecho { color: var(--ink-2); }
.aud-pasos li.hecho::before { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 2px #fff; }

.aud-incluye { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.aud-incluye li { font-size: .8rem; font-weight: 700; color: var(--navy); background: var(--blue-50); padding: 5px 11px; border-radius: 999px; }
.aud-incluye li::before { content: '✓ '; color: var(--ok); }
.aud-cupo { margin: 16px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--orange-50); color: var(--orange-600); font-size: .9rem; }
.aud-mias { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.aud-mias ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aud-mias li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; overflow-wrap: anywhere; }

/* Explicación debajo del formulario */
.aud-que-grid, .aud-planes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.aud-que-col, .aud-plan-col { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.aud-que-col h3, .aud-plan-col h3 { font-size: 1.05rem; color: var(--navy); }
.aud-que-col ul, .aud-plan-col ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .93rem; }
.aud-que-col li, .aud-plan-col li { margin-bottom: 6px; }
.aud-planes { margin-top: 16px; }
.aud-plan-col.destacado { border: 2px solid var(--orange); }
.aud-precio { float: right; font-size: .95rem; color: var(--orange-600); background: var(--orange-50); padding: 2px 10px; border-radius: 999px; }

/* ── Informe ── */
body.tool-auditoria-seo .tool-hero h1 { overflow-wrap: anywhere; }   /* dominios largos en el título */
@media (max-width: 640px) {
  /* Informe: título más chico para que el dominio corte después de un punto y no en cualquier letra */
  body.tool-auditoria-seo:has(#audInforme) .tool-hero h1 { font-size: clamp(1.3rem, 6.2vw, 2rem); overflow-wrap: break-word; }
}
.aud-informe { max-width: 1040px; margin: 0 auto; text-align: left; overflow-wrap: break-word; }
.aud-sec { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin-top: 16px; box-shadow: var(--shadow); }
.aud-sec h2 { font-size: 1.3rem; color: var(--navy); }
.aud-h3 { font-size: 1.02rem; color: var(--navy); margin: 0 0 .4em; }
.aud-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.aud-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.aud-nota { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--blue-50); color: var(--navy); font-size: .92rem; }
.aud-centro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; }
.aud-error h2 { color: var(--err); }
.aud-print-head { display: none; }

.aud-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aud-head-txt { min-width: 0; }
.aud-head-txt p { margin: 0; }
.aud-head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.aud-url { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.aud-badge { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); background: var(--blue-50); padding: 3px 10px; border-radius: 999px; margin-bottom: 4px; }
.aud-badge.completa { color: var(--orange-btn-txt, #141A3C); background: var(--orange); }

/* Progreso de la completa */
.aud-prog { border: 2px solid var(--orange); }
.aud-prog p { margin: 10px 0 0; }
#audProgTxt { font-weight: 700; color: var(--ink); }

/* Puntajes */
.aud-puntajes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; align-items: start; }
.aud-scores { display: grid; gap: 16px; }
.aud-score { display: flex; align-items: center; gap: 14px; }
.aud-score .score { flex-shrink: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.aud-score p { margin: 0; }
.aud-score-nota { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.aud-resumen > p:first-child { font-size: 1rem; }
.aud-conteo { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

/* Gravedad */
.aud-sev { display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: var(--ink-2); }
.aud-sev.sev-critico { background: #d64545; color: #fff; }
.aud-sev.sev-alto { background: var(--err-50); color: #b23636; }
.aud-sev.sev-medio { background: #fff3d6; color: #9a6a00; }
.aud-sev.sev-bajo { background: var(--blue-50); color: var(--blue); }
.aud-sev.sev-info { background: var(--bg); color: var(--muted); }
.aud-sev.sev-ok { background: var(--ok-50); color: var(--ok-700); }

/* Cómo se calculan */
.aud-pesos { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--bg); }
.aud-pesos summary { cursor: pointer; font-weight: 700; color: var(--blue); font-size: .9rem; }
.aud-pesos p { margin: 10px 0; }
.aud-pesos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.aud-pesos h4 { margin: 0 0 4px; font-size: .85rem; color: var(--navy); }
.aud-t-pesos { font-size: .8rem; background: #fff; border-radius: 10px; }
.aud-t-pesos th, .aud-t-pesos td { padding: 6px 8px; }
.aud-t-pesos td:last-child { white-space: nowrap; }
.aud-mini { display: inline-block; width: 46px; height: 6px; border-radius: 6px; background: var(--line); vertical-align: middle; overflow: hidden; }
.aud-mini-barra { display: block; height: 100%; background: var(--ok); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.aud-mini-barra.medio { background: #e9a400; }
.aud-mini-barra.bajo { background: var(--err); }

/* Hallazgos */
.aud-lista { margin-top: 4px; }
.aud-h > div { min-width: 0; }
.aud-h-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.aud-h-top b { display: inline; font-size: .95rem; }
.aud-h small { margin-top: 4px !important; }
.aud-fix { margin: 6px 0 0; font-size: .86rem; color: var(--ink); line-height: 1.45; }
.aud-fix span { font-weight: 800; color: var(--ok); }
.aud-det { margin: 6px 0 0; padding-left: 18px; font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.aud-det li { margin: 2px 0; }
.chequeos .aud-det li { display: list-item; padding: 0; border: 0; }
.chequeos .aud-det li::before { display: none; }
.aud-herr { display: inline-block; margin-top: 6px; font-size: .84rem; font-weight: 700; }
.aud-cat { margin-top: 18px; }
.aud-cat:first-of-type { margin-top: 6px; }
.aud-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 2px solid var(--bg); padding-bottom: 4px; }
.aud-cat-pts { font-weight: 800; font-size: .85rem; padding: 2px 10px; border-radius: 999px; background: var(--ok-50); color: var(--ok-700); white-space: nowrap; }
.aud-cat-pts.medio { background: #fff3d6; color: #9a6a00; }
.aud-cat-pts.bajo { background: var(--err-50); color: #b23636; }
.aud-bien { margin-top: 6px; }
.aud-bien summary { cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--ok); padding: 6px 0; }
.aud-bien .chequeos li { padding: 6px 0; }

/* Bloqueado (versión gratis) */
.aud-bloq-sec { padding: 0; overflow: hidden; }
.aud-bloq { min-height: 470px; }
.aud-bloq .borroso { padding: 18px 22px; }
.aud-desb { text-align: center; max-width: 460px !important; }
.aud-desb h3 { color: var(--navy); font-size: 1.15rem; margin-bottom: .4em; }
.aud-desb p { color: var(--ink-2); }
.aud-desb-btns { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: 12px; }
.aud-desb-btns .btn { white-space: normal; line-height: 1.25; }
.aud-desb-nota { margin: 10px 0 0; }
.aud-desb .err-box { margin-top: 10px; text-align: left; }
.aud-desb-esperando { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-weight: 700; color: var(--navy); }
.aud-desb-esperando.fin .spinner { display: none; }
.aud-desb-alt { align-items: center; margin-top: 14px; }
.aud-desb-alt a { color: var(--blue); text-decoration: underline; padding: 6px 4px; }

/* Velocidad */
.aud-vel { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.aud-vel-item { border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.aud-vel-item h4 { margin: 0 0 10px; color: var(--navy); font-size: 1rem; }
.aud-vel-top { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.aud-score-chico { width: 88px; height: 88px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.aud-score-chico b { font-size: 1.5rem; }
.aud-score-chico span { font-size: .6rem; }
.aud-vel-otras { list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--ink-2); }
.aud-vel-otras b { color: var(--ink); display: inline-block; min-width: 2em; }
.aud-metricas { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.aud-metricas li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.aud-metricas li b { white-space: nowrap; }
.aud-metricas li.ok b { color: var(--ok-700); }
.aud-metricas li.medio b { color: #9a6a00; }
.aud-metricas li.bajo b { color: #b23636; }
.aud-campo { margin: 10px 0 0; }
.aud-ops { margin-top: 10px; font-size: .86rem; }
.aud-ops summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.aud-ops ul { margin: 6px 0 0; padding-left: 18px; }
.aud-vel-pend { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: .9rem; flex-wrap: wrap; }
.aud-vel-pend .spinner { flex-shrink: 0; }
.aud-vel-pend.fallo { color: var(--ink-2); }

/* Prueba en IA */
.aud-ia-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--ok-50); margin-bottom: 12px; }
.aud-ia-total b { font-size: 1.6rem; font-weight: 800; color: var(--ok-700); }
.aud-ia-total.medio { background: #fff3d6; } .aud-ia-total.medio b { color: #9a6a00; }
.aud-ia-total.bajo { background: var(--err-50); } .aud-ia-total.bajo b { color: #b23636; }
.aud-ia-lista { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.aud-ia-lista > li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.aud-ia-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.aud-ia-p { margin: 0; font-weight: 700; }
.aud-ia-lista p.small { margin: 4px 0 0; overflow-wrap: anywhere; }
.aud-ia-resp summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--blue); margin-top: 4px; }
.aud-ia-resp p { font-size: .86rem; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.aud-comp { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.aud-comp li { background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: .84rem; overflow-wrap: anywhere; }
.aud-ok-txt { color: var(--ok-700); font-weight: 700; }
.aud-err-txt { color: #b23636; font-weight: 700; }

/* Plan de acción */
.aud-plan-sec { border: 2px solid var(--navy); }
.aud-plan { margin: 0; padding: 0; list-style: none; counter-reset: paso; display: grid; gap: 12px; }
.aud-plan > li { counter-increment: paso; position: relative; padding: 12px 14px 12px 54px; background: var(--bg); border-radius: 14px; }
.aud-plan > li::before { content: counter(paso); position: absolute; left: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.aud-plan-top { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.aud-plan-top b { margin-right: 4px; }
.aud-plan p { margin: 6px 0 0; font-size: .92rem; color: var(--ink-2); }

/* Etiquetas chicas */
.aud-tag { display: inline-block; font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.aud-tag.warn { background: #fff3d6; color: #9a6a00; }
.aud-tag.err { background: var(--err-50); color: #b23636; }
.aud-tag.info { background: var(--blue-50); color: var(--blue); }
.aud-tag.imp-alto { background: var(--orange-50); color: var(--orange-600); }
.aud-tag.imp-medio { background: var(--blue-50); color: var(--blue); }

/* Tablas */
.aud-tabla-wrap { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; }
.aud-t-pag { font-size: .8rem; min-width: 860px; }
.aud-t-pag td { white-space: nowrap; }
.aud-td-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.aud-t-pag td.small { white-space: normal; }
.aud-t-bots td, .aud-t-kw td { font-size: .85rem; }
.aud-kw-en, .aud-archivos { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.aud-kw-en li, .aud-archivos li { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.aud-kw-en li.ok, .aud-archivos li.ok { background: var(--ok-50); color: var(--ok-700); }
.aud-kw-en li.no, .aud-archivos li.no { background: var(--err-50); color: #b23636; }
.aud-archivos { margin-top: 14px; }
.aud-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: .9rem; }
.aud-dl dt { color: var(--muted); font-weight: 700; }
.aud-dl dd { margin: 0; overflow-wrap: anywhere; }

/* Entregables */
.aud-entregable + .aud-entregable { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.aud-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.5; max-height: 360px; overflow: auto; margin: 8px 0 0; }

/* Llamado a la agencia */
.aud-cta { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 20px; padding: 28px; border-radius: 22px;
  background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; }
.aud-cta h2 { color: #fff; margin-bottom: .3em; }
.aud-cta p { color: #dbe5f8; margin: 0; }
.aud-cta .agencia-badge { background: rgba(255, 255, 255, .14); color: #fff; }
.aud-cta-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.aud-cta-btns .small { color: #c7d5f2; }

/* ── Celular ── */
@media (max-width: 860px) {
  .aud-puntajes, .aud-cta, .aud-que-grid, .aud-planes { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .aud-form-campos { grid-template-columns: 1fr; }
  .aud-form .btn-lg { align-self: stretch; }
  .aud-sec { padding: 16px 14px; border-radius: 16px; }
  .aud-score .score { width: 96px; height: 96px; }
  .aud-score .score b { font-size: 1.6rem; }
  .aud-pesos-grid { grid-template-columns: 1fr; }
  .aud-bloq { min-height: 560px; }
  .aud-bloq .borroso { padding: 14px; }
  .bloqueado > .desbloquear { padding: 12px; }
  .aud-desb { padding: 16px !important; }
  .aud-cta { padding: 20px 16px; }
  .aud-cta-btns .btn { width: 100%; white-space: normal; }
  .aud-plan > li { padding-left: 48px; }
  .aud-dl { grid-template-columns: 1fr; gap: 0 0; }
  .aud-dl dd { margin-bottom: 8px; }
  .aud-head-btns { width: 100%; }
  .aud-head-btns .btn { flex: 1; }
}

/* ── PDF (Imprimir → Guardar como PDF) ── */
@media print {
  @page { margin: 14mm 12mm; }
  body { background: #fff !important; font-size: 11pt; }
  .site-header, .site-footer, .tool-hero .hero-copy, #herramientas, .faq, .agencia-mini, .modal, .aha-aviso, .aud-no-print,
  body.tool-auditoria-seo main > section:not(.tool-hero), .flash { display: none !important; }
  .tool-hero { padding: 0 !important; background: none !important; }
  .tool-hero .wrap { padding: 0 !important; max-width: none; }
  .aud-informe { max-width: none; }
  .aud-print-head { display: block; font-size: 10pt; color: #141A3C; border-bottom: 2px solid #FE8202; padding-bottom: 6px; margin-bottom: 10px; }
  .aud-print-head b { color: #A84F00; }
  .aud-sec { box-shadow: none; border: 1px solid #d9dfeb; break-inside: auto; padding: 14px 16px; }
  .aud-sec h2, .aud-h3, .aud-cat-head { break-after: avoid; }
  .aud-h, .aud-plan > li, .aud-vel-item, .aud-ia-lista > li, .aud-score { break-inside: avoid; }
  .aud-puntajes { grid-template-columns: 1fr; gap: 12px; }
  .aud-scores { grid-template-columns: 1fr 1fr; }
  .aud-pesos-grid { grid-template-columns: 1fr 1fr; }
  .aud-vel { grid-template-columns: 1fr 1fr; }
  .aud-tabla-wrap, .table-wrap { overflow: visible !important; border: 0; }
  .aud-t-pag { min-width: 0; font-size: 7.5pt; }
  .aud-t-pag td { white-space: normal; }
  .aud-t-pag { table-layout: fixed; width: 100%; }
  table.t.aud-t-pag th { font-size: 6.5pt; letter-spacing: 0; overflow-wrap: normal; word-break: normal; white-space: normal; hyphens: auto; }
  table.t.aud-t-pag th, table.t.aud-t-pag td { padding: 4px 3px; }
  .aud-t-pag td { overflow-wrap: anywhere; }
  /* Anchos fijos: en una hoja A4 cada encabezado entra en su columna sin pisar al de al lado */
  .aud-t-pag th:nth-child(1) { width: 21%; }
  .aud-t-pag th:nth-child(2) { width: 7%; }
  .aud-t-pag th:nth-child(3) { width: 10%; }
  .aud-t-pag th:nth-child(4) { width: 12%; }
  .aud-t-pag th:nth-child(5) { width: 7%; }
  .aud-t-pag th:nth-child(6) { width: 9%; }
  .aud-t-pag th:nth-child(7) { width: 10%; }
  .aud-t-pag th:nth-child(8) { width: 10%; }
  .aud-t-pag th:nth-child(9) { width: 14%; }
  .aud-t-pag .aud-tag { padding: 0 4px; font-size: 6pt; }
  .aud-td-url { max-width: none; word-break: break-all; }
  .aud-code { max-height: none; overflow: visible; white-space: pre-wrap; }
  a { color: inherit; text-decoration: none; }
  .aud-sev, .aud-tag, .aud-cat-pts, .aud-ia-total, .aud-badge, .aud-kw-en li, .aud-archivos li, .chequeos li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
