/* ==========================================================================
   TUWEBLOCAL — Analizador de Autoridad de Dominio (herramienta gratuita)
   Paleta de marca: brand #4ea9d5 · deep #176be0 · soft #eaf7fc · navy #0f3a4d
   ========================================================================== */

.twl-tool { font-family: 'Montserrat', sans-serif; color: #1a1a1a; }
.twl-tool * { box-sizing: border-box; }

/* --- Hero con el formulario COMO protagonista --- */
.twl-tool-hero { background: linear-gradient(180deg, #eaf7fc 0%, #ffffff 100%); border-radius: 16px; border: 1px solid #d1edf9; padding: 56px 24px 48px; text-align: center; margin-bottom: 40px; }
.twl-tool-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.15; letter-spacing: -1px; margin: 0 auto 14px; max-width: 800px; }
.twl-tool-hero h1 .twl-tool-gratis { color: #176be0; }
.twl-tool-sub { font-size: 1.1rem; color: #41545f; max-width: 640px; margin: 0 auto 30px; line-height: 1.55; }

.twl-tool-form { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.twl-tool-form input[type="text"] { flex: 1; min-width: 0; font: 600 1.05rem 'Montserrat', sans-serif; padding: 16px 20px; border: 2px solid #b9dff0; border-radius: 50px; outline: none; color: #1a1a1a; background: #fff; transition: border-color .2s, box-shadow .2s; }
.twl-tool-form input[type="text"]:focus { border-color: #176be0; box-shadow: 0 0 0 4px rgba(23,107,224,.15); }
.twl-tool-form input::placeholder { color: #8aa4b3; font-weight: 500; }
.twl-tool-btn { font: 700 1.05rem 'Montserrat', sans-serif; color: #fff; background: #176be0; border: 2px solid #176be0; border-radius: 50px; padding: 16px 34px; cursor: pointer; white-space: nowrap; transition: transform .15s, background .2s, box-shadow .2s; box-shadow: 0 4px 15px rgba(23,107,224,.3); }
.twl-tool-btn:hover:not(:disabled) { background: #1259ba; transform: translateY(-2px); }
.twl-tool-btn:focus-visible { outline: 3px solid #0f3a4d; outline-offset: 2px; }
.twl-tool-btn:disabled { opacity: .6; cursor: wait; }
.twl-tool-nota { font-size: .85rem; color: #64808f; margin-top: 14px; }

/* --- Estado de carga --- */
.twl-tool-carga { display: none; text-align: center; padding: 44px 20px; }
.twl-tool-carga.activa { display: block; }
.twl-tool-spinner { width: 54px; height: 54px; margin: 0 auto 18px; border: 5px solid #eaf7fc; border-top-color: #176be0; border-radius: 50%; animation: twlgira .9s linear infinite; }
@keyframes twlgira { to { transform: rotate(360deg); } }
.twl-tool-carga p { font-weight: 600; color: #0f3a4d; font-size: 1.05rem; min-height: 1.6em; }
.twl-tool-carga small { color: #64808f; }

/* --- Error --- */
.twl-tool-error { display: none; background: #fff4e5; border: 1px solid #ffe0b2; border-left: 6px solid #ff9800; border-radius: 12px; padding: 22px 26px; margin: 24px auto; max-width: 640px; }
.twl-tool-error.activa { display: block; }
.twl-tool-error p { margin: 0 0 12px; font-weight: 600; color: #1a1a1a; }
.twl-tool-reintentar { background: none; border: 2px solid #176be0; color: #176be0; font: 700 .95rem 'Montserrat', sans-serif; border-radius: 50px; padding: 9px 22px; cursor: pointer; }
.twl-tool-reintentar:hover { background: #176be0; color: #fff; }

/* --- Resultados --- */
.twl-tool-res { display: none; }
.twl-tool-res.activa { display: block; animation: twlaparece .45s ease; }
@keyframes twlaparece { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.twl-tool-cabres { display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap; background: #fff; border: 1px solid #edf5f9; border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.06); padding: 34px 26px; margin-bottom: 26px; }
.twl-tool-circulo { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.twl-tool-circulo svg { transform: rotate(-90deg); }
.twl-tool-circulo .fondo { fill: none; stroke: #eef4f7; stroke-width: 13; }
.twl-tool-circulo .valor { fill: none; stroke-width: 13; stroke-linecap: round; transition: stroke-dashoffset 1.1s ease, stroke .3s; }
.twl-tool-numero { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.twl-tool-numero strong { font-size: 2.6rem; line-height: 1; letter-spacing: -1px; }
.twl-tool-numero span { font-size: .78rem; font-weight: 600; color: #64808f; text-transform: uppercase; letter-spacing: 1px; }
.twl-tool-resumen { max-width: 420px; text-align: left; }
.twl-tool-resumen h2 { font-size: 1.35rem; margin: 0 0 8px; line-height: 1.3; word-break: break-word; }
.twl-tool-resumen p { color: #41545f; margin: 0 0 14px; font-size: .98rem; line-height: 1.5; }
.twl-tool-copiar { background: none; border: 2px solid #176be0; color: #176be0; font: 700 .9rem 'Montserrat', sans-serif; border-radius: 50px; padding: 9px 20px; cursor: pointer; transition: background .2s, color .2s; }
.twl-tool-copiar:hover { background: #176be0; color: #fff; }

.c-verde { color: #2e7d32; } .s-verde { stroke: #43a047; }
.c-naranja { color: #e65100; } .s-naranja { stroke: #fb8c00; }
.c-rojo { color: #c62828; } .s-rojo { stroke: #e53935; }

/* Tarjetas por categoría */
.twl-tool-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 30px; }
.twl-tool-cat { background: #fff; border: 1px solid #edf5f9; border-radius: 14px; box-shadow: 0 4px 15px rgba(0,0,0,.04); padding: 20px 22px; }
.twl-tool-cat header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.twl-tool-cat h3 { font-size: 1rem; margin: 0; line-height: 1.3; }
.twl-tool-cat .nota { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; }
.twl-tool-barra { height: 8px; background: #eef4f7; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.twl-tool-barra i { display: block; height: 100%; border-radius: 6px; transition: width 1s ease; }
.b-verde { background: #43a047; } .b-naranja { background: #fb8c00; } .b-rojo { background: #e53935; }
.twl-tool-cat ul { list-style: none; margin: 0; padding: 0; }
.twl-tool-cat li { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; padding: 6px 0; border-top: 1px solid #f2f7fa; color: #41545f; }
.twl-tool-cat li b { color: #1a1a1a; font-weight: 600; flex-shrink: 0; }
.twl-tool-cat li span { text-align: right; word-break: break-word; }
.li-ok span::before { content: '✓ '; color: #43a047; font-weight: 800; }
.li-mal span::before { content: '✗ '; color: #e53935; font-weight: 800; }
.li-aviso span::before { content: '· '; color: #fb8c00; font-weight: 800; }

/* Problemas y recomendaciones (acordeón accesible con <details>) */
.twl-tool-problemas { margin-bottom: 30px; }
.twl-tool-problemas h2 { font-size: 1.4rem; margin: 0 0 16px; }
.twl-tool-prob { border: 1px solid #edf5f9; border-radius: 12px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.twl-tool-prob summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: .97rem; list-style: none; }
.twl-tool-prob summary::-webkit-details-marker { display: none; }
.twl-tool-prob summary:focus-visible { outline: 3px solid #176be0; outline-offset: -3px; }
.twl-tool-prob[open] summary { border-bottom: 1px solid #f2f7fa; }
.twl-tool-prob .cuerpo { padding: 14px 18px 16px 52px; color: #41545f; font-size: .93rem; line-height: 1.55; }
.twl-sev { flex-shrink: 0; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 4px 10px; border-radius: 20px; }
.sev-alta { background: #fdecea; color: #c62828; }
.sev-media { background: #fff4e5; color: #e65100; }
.sev-baja { background: #eaf7fc; color: #0f5c8c; }
.twl-tool-sinprob { background: #e8f5e9; border: 1px solid #c8e6c9; border-left: 6px solid #4caf50; border-radius: 12px; padding: 20px 24px; font-weight: 600; }

/* CTA de conversión tras los resultados */
.twl-tool-cta { background: #0f3a4d; color: #fff; border-radius: 16px; padding: 36px 28px; text-align: center; margin-bottom: 10px; }
.twl-tool-cta h2 { color: #fff; font-size: 1.5rem; margin: 0 0 10px; }
.twl-tool-cta p { color: #cfe6f2; max-width: 560px; margin: 0 auto 22px; line-height: 1.55; }

/* Cómo funciona */
.twl-tool-pasos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 26px 0 10px; }
.twl-tool-paso { background: #fff; border: 1px solid #edf5f9; border-radius: 14px; padding: 26px 22px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,.04); }
.twl-tool-paso .icono { font-size: 2rem; margin-bottom: 12px; }
.twl-tool-paso h3 { font-size: 1.05rem; margin: 0 0 8px; }
.twl-tool-paso p { color: #41545f; font-size: .92rem; margin: 0; line-height: 1.5; }

/* Responsive */
@media (max-width: 640px) {
  .twl-tool-form { flex-direction: column; }
  .twl-tool-btn { width: 100%; }
  .twl-tool-cabres { gap: 20px; }
  .twl-tool-resumen { text-align: center; }
  .twl-tool-prob .cuerpo { padding-left: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .twl-tool-spinner, .twl-tool-circulo .valor, .twl-tool-barra i, .twl-tool-res.activa { animation: none; transition: none; }
}
