/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
    --azul: #003A73;
    --azul-oscuro: #00264d;
    --azul-claro: #eaf2fa;
    --rojo: #C62828;
    --texto: #243447;
    --muted: #475569;
    --fondo: #f4f7fb;
    --borde: #dce4ee;
    --blanco: #fff;
    --radio: 16px;
    --sombra: 0 12px 32px rgba(0, 39, 79, .08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--fondo);
    color: var(--texto);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.body-consulta {
    min-height: 100vh;
}

.flex-grow {
    flex: 1 0 auto;
}

a {
    color: var(--azul);
}

.contenedor {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

/* ==========================================================================
   2. ENCABEZADO (HEADER)
   ========================================================================== */
.encabezado {
    background: var(--blanco);
    border-bottom: 1px solid var(--borde);
}

.encabezado-interior {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.marca {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--azul);
    text-decoration: none;
    min-width: 0;
}

.marca-emblema {
    width: 190px;
    height: 60px;
    flex: 0 0 190px;
    display: grid;
    place-items: center;
    background: var(--azul);
    border-radius: 8px;
    border-bottom: 4px solid var(--rojo);
    overflow: hidden;
}

.marca-emblema img {
    width: 184px;
    height: 56px;
    object-fit: contain;
    display: block;
}

.marca-texto {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.marca-texto strong {
    font-size: 15px;
    line-height: 1.3;
}

.marca-texto small {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.enlace-regreso {
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.enlace-regreso:hover,
.enlace-texto:hover {
    text-decoration: underline;
}

/* ==========================================================================
   3. HERO SECCIÓN
   ========================================================================== */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--azul-oscuro) 0%, var(--azul) 100%);
    color: #fff;
    z-index: 10;
}

.hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border: 50px solid rgba(255, 255, 255, .045);
    border-radius: 50%;
    right: -70px;
    top: -140px;
}

.hero-interior {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding-top: 45px;
    padding-bottom: 45px;
}

.hero-contenido-principal {
    flex: 1;
    min-width: 0;
}

.hero-ilustracion {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circulo-lobito {
    display: grid;
    place-items: center;
    width: 145px;
    height: 145px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: flotar 4s ease-in-out infinite;
}

.icono-lobito {
    width: 110px;
    height: 110px;
    display: block;
}

@keyframes flotar {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.hero-etiqueta,
.hero-notas {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.hero-etiqueta {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #e2effb;
}

.punto {
    width: 9px;
    height: 9px;
    background: #ff5252;
    border-radius: 50%;
    display: inline-block;
}

.hero h1 {
    font-size: clamp(14px, 2.8vw, 50px);
    white-space: nowrap;
    line-height: 1.12;
    letter-spacing: -1px;
    max-width: 700px;
    margin: 8px 0 16px 0;
}

.hero p {
    width: 92%;
    max-width: 100%;
    color: #f0f5fc;
    font-size: 15px;
    line-height: 1.35;
    text-align: justify;
    margin-top: 15px;
}

.hero-notas {
    margin-top: 25px;
    gap: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   4. CONTENIDO PRINCIPAL Y FORMULARIO
   ========================================================================== */
.contenido {
    padding-top: 28px;
    padding-bottom: 56px;
}

.aviso-privacidad {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    background: #fff;
    border: 1px solid #d6e4f3;
    border-left: 4px solid var(--rojo);
    padding: 16px 19px;
    border-radius: 12px;
    margin-bottom: 23px;
}

.aviso-icono {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--azul-claro);
    color: var(--azul);
    font-weight: 900;
    font-size: 15px;
}

.aviso-privacidad strong {
    font-size: 15px;
    color: var(--azul);
}

.aviso-privacidad p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--texto);
}

/* Layout responsivo de formulario y sidebar (Versión Computadora) */
.formulario-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "formulario lateral";
    /* Asignamos las áreas fijas para PC */
    gap: 23px;
    align-items: start;
}

/* Asignamos el formulario al área izquierda */
.tarjeta-formulario {
    grid-area: formulario;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: clamp(16px, 4vw, 35px);
}

.titulo-seccion {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 24px;
}

.numero-seccion {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--azul-claro);
    color: var(--azul);
    font-size: 14px;
    font-weight: 900;
}

.titulo-seccion h2 {
    font-size: 20px;
    line-height: 1.25;
    margin: 1px 0 5px;
    color: var(--azul);
}

.titulo-seccion p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    font-weight: 500;
}

.requerido {
    color: var(--rojo);
    font-weight: 900;
}

.opcional {
    font-size: 12px;
    color: var(--azul);
    font-weight: 700;
    margin-left: 6px;
    background: var(--azul-claro);
    padding: 2px 6px;
    border-radius: 4px;
}

.campo-grupo {
    padding: 0;
    border: 0;
    margin: 0 0 22px;
    min-width: 0;
}

.campo-grupo legend,
.campo label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}

.opciones-tipo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.opcion-tipo {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 13px 10px;
    border: 1px solid var(--borde);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .18s, background .18s;
}

.opcion-tipo>span:last-child {
    min-width: 0;
    flex: 1;
}

.opcion-tipo:has(input:checked) {
    border-color: var(--azul);
    background: #f0f6fc;
    box-shadow: 0 0 0 1px var(--azul);
}

.opcion-tipo input {
    margin: 4px 0 0;
    accent-color: var(--azul);
    flex: 0 0 auto;
}

.opcion-icono {
    display: grid;
    place-items: center;
    flex: 0 0 29px;
    height: 29px;
    border-radius: 9px;
    font-weight: 900;
}

.queja-icono {
    background: #fdeeee;
    color: var(--rojo);
}

.sugerencia-icono {
    background: #eaf2fa;
    color: var(--azul);
}

.felicitacion-icono {
    background: #fff2e7;
    color: #a34d0c;
}

.opcion-tipo strong,
.opcion-tipo small {
    display: block;
    overflow-wrap: break-word;
}

.opcion-tipo strong {
    font-size: 13px;
    font-weight: 800;
}

.opcion-tipo small {
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 500;
}

.campo {
    margin-bottom: 19px;
}

.campo input,
.campo select,
.campo textarea {
    display: block;
    width: 100%;
    border: 1px solid #cfd9e5;
    background: #fff;
    border-radius: 9px;
    padding: 12px 13px;
    color: var(--texto);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.campo input,
.campo select {
    min-height: 45px;
}

.campo textarea {
    resize: vertical;
    min-height: 130px;
}

.campo input::placeholder,
.campo textarea::placeholder {
    color: #94a3b8;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(0, 58, 115, .15);
}

.ayuda {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #475569;
    font-weight: 600;
}

.separador {
    height: 1px;
    background: var(--borde);
    margin: 27px 0;
}

.campos-dos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.confirmacion {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 22px;
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.confirmacion input {
    margin-top: 4px;
    accent-color: var(--azul);
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   5. BOTONES Y ACCIONES
   ========================================================================== */
.boton-principal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 19px;
    border-radius: 9px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, background .15s;
    width: 100%;
    border: 1px solid var(--azul);
    background: var(--azul);
    color: #fff;
}

.boton-principal:hover {
    background: var(--azul-oscuro);
    transform: translateY(-1px);
}

.boton-principal span {
    font-size: 18px;
    line-height: 1;
}

.contenedor-boton-regreso {
    margin-top: 24px;
    text-align: left;
}

.boton-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    min-height: 43px;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: #f1f5f9;
    color: var(--azul);
    border: 2px solid #cbd5e1;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    margin-top: 8px;
}

.boton-secundario:hover {
    background-color: #e2e8f0;
    border-color: var(--azul);
    color: var(--azul-oscuro);
    transform: translateY(-1px);
}

.nota-envio {
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: var(--muted);
    margin: 12px 0 0;
    font-weight: 600;
}

/* ==========================================================================
   6. COLUMNA LATERAL (SIDEBAR) Y NOTAS Y LAYOUT PRINCIPAL
   ========================================================================== */

.columna-lateral {
    grid-area: lateral;
    /* Asignamos la columna lateral al área derecha */
    display: grid;
    gap: 20px;
}

.tarjeta-lateral {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 22px;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tarjeta-lateral:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

/* Cabecera interna para alinear icono y título */
.lateral-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tarjeta-lateral h3 {
    font-size: 17px;
    margin: 0;
    color: var(--azul);
    font-weight: 850;
}

/* Iconos de cabecera lateral */
.lateral-icono {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e5effa;
    color: var(--azul);
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
}

.lateral-icono.rojo {
    background: #fdeeee;
    color: var(--rojo);
}

/* Textos generales dentro de las tarjetas */
.tarjeta-lateral p,
.tarjeta-lateral li {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.5;
}

.tarjeta-lateral p {
    margin: 12px 0 16px 0;
}

/* --- 1. TARJETA AZUL ("¿Cómo funciona?") --- */
.lateral-azul {
    background: linear-gradient(135deg, var(--azul) 0%, #0052a3 100%);
    color: #fff;
    border-color: var(--azul);
    box-shadow: 0 6px 20px rgba(0, 58, 115, 0.15);
}

.lateral-azul h3 {
    color: #fff;
}

.lateral-azul .lateral-icono {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.lateral-azul p,
.lateral-azul li {
    color: #f0f5fc;
}

/* Lista numerada estilizada */
.tarjeta-lateral ol {
    padding-left: 0;
    margin: 14px 0 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tarjeta-lateral ol li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding-left: 0;
}

.tarjeta-lateral ol li::before {
    content: counter(item);
    counter-increment: item;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.tarjeta-lateral ol {
    counter-reset: item;
}

/* --- 2. TARJETA CON FRANJA ROJA ("¿Ya tienes un folio?") --- */
.columna-lateral .tarjeta-lateral:not(.lateral-azul) {
    border-left: 5px solid var(--rojo);
    /* ¡Franja roja lateral elegante! */
}

/* --- 3. NOTA CONFIDENCIAL / ALERTA --- */
.nota-confidencial {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: #fff6f3;
    border: 1px solid #f3d7d0;
    border-left: 4px solid var(--rojo);
    /* Franja de acento en la nota */
    color: var(--rojo);
    box-sizing: border-box;
}

.nota-confidencial>span {
    font-size: 19px;
    line-height: 1;
    margin-top: 2px;
}

.nota-confidencial p {
    margin: 0;
    color: #7c5551;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.nota-confidencial strong {
    display: block;
    color: #7b2525;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 2px;
}

/* ==========================================================================
   7. SECCIÓN DE CONSULTAS Y RESULTADOS (consultar.php)
   ========================================================================== */
.datos-reporte .icono-info {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.7;
}

.seccion-respuestas h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.seccion-respuestas h2 .icono-seccion {
    width: 20px;
    height: 20px;
    color: var(--azul);
}

.tarjeta-respuesta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--azul);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.respuesta-pie {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.badge-fecha {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #64748b;
}

.alerta-sin-respuesta {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    padding: 1rem;
    border-radius: 8px;
    color: #92400e;
}

.pantalla-resultado {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   8. PIE DE PÁGINA (FOOTER)
   ========================================================================== */
.pie {
    background: #fff;
    border-top: 1px solid var(--borde);
}

.pie-interior {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: var(--texto);
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   9. MEDIA QUERIES (ADAPTACIÓN MÓVIL)
   ========================================================================== */
@media (max-width: 768px) {

    /* Header adaptativo */
    .encabezado-interior {
        flex-direction: column;
        justify-content: center;
        padding: 15px 0;
        gap: 12px;
        text-align: center;
    }

    .marca {
        flex-direction: column;
        justify-content: center;
    }

    .marca-emblema {
        width: 160px;
        height: 52px;
        flex: 0 0 52px;
    }

    .marca-emblema img {
        width: 154px;
        height: 48px;
    }

    .marca-texto {
        text-align: center;
    }

    /* Hero móvil más compacto */
    .hero-interior {
        flex-direction: column-reverse;
        text-align: center;
        gap: 12px;
        padding-top: 10px;
        padding-bottom: 15px;
    }

    .hero-etiqueta,
    .hero-notas {
        justify-content: center;
    }

    .hero h1 {
        margin-inline: auto;
        font-size: 23px;
        line-height: 1.2;
        white-space: normal;
        /* Permite ajuste de texto en móvil */
    }

    .hero p {
        width: 100%;
        max-width: 100%;
        font-size: 13px;
        text-align: justify;
    }

    .circulo-lobito {
        width: 80px;
        height: 80px;
    }

    .icono-lobito {
        width: 60px;
        height: 60px;
    }

    /* Convertimos el layout principal en una sola columna en móvil */
    .formulario-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Desarmamos la columna lateral para que sus hijos compitan directamente en el flex principal */
    .columna-lateral {
        display: contents;
    }

    /* ORDEN EXACTO Y ANCHO UNIFICADO PARA TODAS LAS TARJETAS Y NOTAS EN MÓVIL */

    /* 1. La tarjeta azul ("¿Cómo funciona?") va PRIMERO */
    .lateral-azul {
        order: 1;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    /* 2. El formulario principal va en SEGUNDO lugar */
    .tarjeta-formulario {
        order: 2;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    /* 3. La tarjeta roja ("¿Ya tienes un folio?") va en TERCER lugar */
    .columna-lateral .tarjeta-lateral:not(.lateral-azul) {
        order: 3;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    /* 4. La nota confidencial va al ÚLTIMO (CUARTO lugar) */
    .nota-confidencial {
        order: 4;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    /* Ajustes generales de campos para móvil */
    .campos-dos {
        grid-template-columns: 1fr;
    }

    .opciones-tipo {
        grid-template-columns: 1fr;
    }

    .boton-principal,
    .boton-secundario {
        width: 100%;
        text-align: center;
        padding: 14px;
        box-sizing: border-box;
    }

    /* Footer móvil */
    .pie-interior {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 15px 0;
        gap: 8px;
    }
}
