/* Componentes comunes a las herramientas: formularios, botones, carga,
   errores, notas, resumen, recuadros, controles, chips, métricas, contenido
   indexable y tablas. */
/* --- FORMULARIOS --- */
.formulario {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.campo {
    flex: 1 1 260px;
    min-width: 0;
}

.campo-corto {
    flex: 0 0 120px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--texto-2);
    font-size: 0.82rem;
    font-weight: 500;
}

input[type="url"],
input[type="text"],
select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--borde-fuerte);
    border-radius: var(--radio);
    background: var(--superficie);
    color: var(--texto);
    font-family: inherit;
    font-size: 0.95rem;
}

input::placeholder {
    color: var(--texto-3);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--acento);
    box-shadow: 0 0 0 3px var(--acento-suave);
}

/* --- BOTONES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radio);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--acento-suave);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--acento);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--acento-hover);
}

/* Botón secundario: contorno, para acciones que no son la principal. */
.btn-secondary {
    background: var(--superficie);
    border-color: var(--borde-fuerte);
    color: var(--texto);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--superficie-2);
    border-color: var(--texto-3);
}

.btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

/* --- CARGA, ERRORES Y NOTAS --- */
.cargando {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    color: var(--texto-2);
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--borde-fuerte);
    border-top-color: var(--acento);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.area-resultado {
    margin-top: 28px;
}

.area-error {
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--error-borde);
    border-radius: var(--radio);
    background: var(--error-fondo);
    color: var(--error);
}

.nota {
    color: var(--texto-3);
    font-size: 0.82rem;
}

/* Renglón que encabeza un resultado: qué se consultó y lo esencial. */
.resumen {
    margin: 0 0 16px;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

/* Recuadro destacado con borde lateral: valor actual, advertencias. */
.recuadro {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-left: 3px solid var(--tono, var(--borde-fuerte));
    background: var(--superficie-2);
}

/* Lista de controles de una revisión (auditoría DNS, caché HTTP): estado,
   título, detalle y valores afectados. */
.control {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--borde);
}

.control:last-child {
    border-bottom: none;
}

.control .chip {
    justify-self: start;
    align-self: start;
    margin-top: 2px;
}

.control-titulo {
    font-weight: 500;
}

.control-detalle {
    color: var(--texto-2);
    font-size: 0.88rem;
}

.control-items {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--texto-2);
    word-break: break-all;
}

.chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--tono-fondo, #efeeeb);
    color: var(--tono, var(--texto-2));
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Fila de cifras resumen. */
.metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    margin-bottom: 24px;
    overflow: hidden;
}

/* Bordes derecho e inferior desplazados 1px: el de la última columna y el de
   la última fila quedan fuera y el contenedor los recorta. */
.metrica {
    padding: 14px 16px;
    border-right: 1px solid var(--borde);
    border-bottom: 1px solid var(--borde);
    margin-right: -1px;
    margin-bottom: -1px;
}

.metrica-valor {
    display: block;
    color: var(--tono, var(--texto));
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.metrica-etiqueta {
    color: var(--texto-2);
    font-size: 0.8rem;
}

/* --- CONTENIDO DE CADA PÁGINA (lo arma lib/contenido/html.js) ---
   Qué es, cómo se usa, preguntas frecuentes, bloque hacia ehostingperu.net y
   otras herramientas. */
.contenido {
    max-width: 760px;
    margin-top: 48px;
}

.contenido h2 {
    margin: 36px 0 10px;
}

.contenido p,
.contenido li {
    color: var(--texto-2);
}

.contenido ol {
    padding-left: 22px;
}

.contenido li+li {
    margin-top: 6px;
}

.pregunta {
    padding: 12px 0;
    border-bottom: 1px solid var(--borde);
}

.pregunta summary {
    color: var(--texto);
    font-weight: 500;
    cursor: pointer;
}

.pregunta p {
    margin: 8px 0 0;
}

.llamado {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 36px;
    padding: 20px 24px;
    border: 1px solid var(--borde);
    border-left: 3px solid var(--acento);
    border-radius: 8px;
    background: var(--superficie);
}

.contenido .llamado p {
    flex: 1 1 320px;
    margin: 0;
    color: var(--texto);
}

.relacionadas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.relacionadas a {
    font-weight: 500;
    text-decoration: none;
}

.relacionadas span {
    display: block;
    color: var(--texto-3);
    font-size: 0.85rem;
}

/* --- TABLAS --- */
.tabla-envoltura {
    overflow-x: auto;
    margin-bottom: 8px;
}

.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tabla th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--borde-fuerte);
    color: var(--texto-3);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.tabla td {
    padding: 10px;
    border-bottom: 1px solid var(--borde);
    vertical-align: top;
}

.tabla tr:last-child td {
    border-bottom: none;
}

.numero {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .control {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .campo-corto,
    .formulario .btn {
        flex: 1 1 100%;
    }

    /* Con menos de 16px, Safari de iOS amplía la página al enfocar el campo. */
    input[type="url"],
    input[type="text"],
    select {
        font-size: 1rem;
    }
}