* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f1f3f5;
    color: #222;
    padding: 20px;
}

.contenedor {
    max-width: 1100px;
    margin: auto;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
}


/* =========================
   ENCABEZADO
========================= */

.encabezado {
    min-height: 120px;
    background: #111;
    color: white;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 20px 35px;
}

.logo-izquierdo img,
.logo-derecho img {
    max-width: 150px;
    max-height: 70px;
    object-fit: contain;
}

.titulo {
    text-align: center;
}

.titulo h1 {
    font-size: 28px;
    letter-spacing: 1px;
}

.titulo p {
    margin-top: 8px;
    font-size: 18px;
}


/* =========================
   SECCIONES
========================= */

.seccion {
    padding: 30px 40px;
    border-bottom: 1px solid #ddd;
}

.seccion h2 {
    margin-bottom: 25px;
    font-size: 22px;
}


/* =========================
   FORMULARIO
========================= */

.formulario {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.campo {
    display: flex;
    flex-direction: column;
}

.campo label {
    font-weight: bold;
    margin-bottom: 8px;
}

input[type="text"],
input[type="date"],
textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font-size: 16px;
}

input:focus,
textarea:focus {
    outline: none;
    border: 2px solid #555;
}


/* =========================
   PREGUNTAS
========================= */

.instruccion {
    margin-bottom: 25px;
    color: #666;
}

.pregunta {
    margin-bottom: 30px;
}

.pregunta > label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}


/* =========================
   ESTRELLAS
========================= */

.estrellas {
    display: flex;
    gap: 8px;
    direction: rtl;
    justify-content: flex-start;
}

.estrellas input {
    display: none;
}

.estrellas label {
    font-size: 45px;
    cursor: pointer;
    color: #bbb;
    transition: 0.2s;
}

.estrellas label:hover,
.estrellas label:hover ~ label,
.estrellas input:checked ~ label {
    color: #f5b400;
}


/* =========================
   OPCIONES
========================= */

.opciones {
    display: flex;
    gap: 30px;
}

.opciones label {
    font-size: 20px;
    cursor: pointer;
}

.opciones input {
    width: 22px;
    height: 22px;
}


/* =========================
   COMENTARIOS
========================= */

textarea {
    margin-top: 15px;
    min-height: 130px;
    resize: vertical;
}


/* =========================
   BOTONES
========================= */

.botones {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    flex-wrap: wrap;
}

button {
    border: none;
    padding: 17px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    transform: scale(1.03);
}

.btn-enviar {
    background: #222;
    color: white;
}

.btn-imprimir {
    background: #555;
    color: white;
}

.btn-limpiar {
    background: #ddd;
    color: #222;
}


/* =========================
   FOOTER
========================= */

footer {
    text-align: center;
    padding: 25px;
    background: #f5f5f5;
}

footer p {
    font-weight: bold;
    margin-bottom: 8px;
}

footer small {
    color: #666;
}


/* =========================
   TABLETA
========================= */

@media (max-width: 800px) {

    body {
        padding: 0;
    }

    .contenedor {
        border-radius: 0;
    }

    .encabezado {
        flex-direction: column;
        gap: 15px;
        padding: 25px 15px;
    }

    .titulo h1 {
        font-size: 22px;
    }

    .formulario {
        grid-template-columns: 1fr;
    }

    .seccion {
        padding: 25px 20px;
    }

    .estrellas label {
        font-size: 42px;
    }

    button {
        width: 100%;
    }
}

@media print {

    /* ==========================================
       CONFIGURACIÓN DE IMPRESIÓN - TAMAÑO CARTA
       ========================================== */

    @page {
        size: Letter portrait;
        margin: 6mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box;
    }

    html,
    body {
        width: 100%;
        height: auto;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        font-size: 11px;
    }

    body {
        color: #222 !important;
    }

    /* CONTENEDOR */
    .contenedor {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* ==========================================
       ENCABEZADO
       ========================================== */

    .encabezado {
        width: 100% !important;
        height: 75px !important;
        min-height: 75px !important;

        display: grid !important;
        grid-template-columns: 120px 1fr 120px !important;

        align-items: center !important;

        padding: 8px 12px !important;

        background: #111 !important;
        color: white !important;

        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* LOGOS */

    .logo {
        display: flex !important;
        align-items: center !important;
    }

    .logo img {
        max-width: 90px !important;
        max-height: 45px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    .logo-izquierdo {
        justify-content: flex-start !important;
    }

    .logo-derecho {
        justify-content: flex-end !important;
    }

    /* TÍTULO */

    .titulo {
        width: 100% !important;
        text-align: center !important;
    }

    .titulo h1 {
        margin: 0 !important;
        padding: 0 !important;

        font-size: 19px !important;
        line-height: 1.1 !important;

        letter-spacing: 0.5px !important;

        color: white !important;
    }

    .titulo p {
        margin: 3px 0 0 0 !important;
        padding: 0 !important;

        font-size: 11px !important;

        color: white !important;
    }

    /* ==========================================
       CONTENIDO
       ========================================== */

    main {
        padding: 8px !important;
        margin: 0 !important;
    }

    section {
        margin: 0 0 6px 0 !important;
        padding: 6px !important;

        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    h2 {
        font-size: 13px !important;
        margin: 0 0 5px 0 !important;
        padding: 0 !important;
    }

    h3 {
        font-size: 12px !important;
        margin: 3px 0 !important;
    }

    p {
        margin: 2px 0 !important;
        line-height: 1.2 !important;
    }

    /* ==========================================
       FORMULARIO
       ========================================== */

    .formulario {
        display: grid !important;

        grid-template-columns: repeat(2, 1fr) !important;

        gap: 5px 10px !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    .campo {
        margin: 0 !important;
        padding: 0 !important;
    }

    label {
        display: block !important;

        font-size: 9px !important;

        margin-bottom: 2px !important;

        font-weight: bold !important;
    }

    input[type="text"],
    input[type="date"] {
        width: 100% !important;
        height: 23px !important;

        padding: 3px 5px !important;

        font-size: 10px !important;

        background: white !important;
        color: #222 !important;

        border: 1px solid #999 !important;

        border-radius: 3px !important;
    }

    /* ==========================================
       PREGUNTAS
       ========================================== */

    .pregunta {
        margin: 0 0 4px 0 !important;
        padding: 4px !important;

        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .pregunta p {
        font-size: 10px !important;

        font-weight: bold !important;

        margin: 0 0 3px 0 !important;
    }

    /* ==========================================
       ESTRELLAS
       ========================================== */

    .estrellas {
        display: flex !important;

        gap: 3px !important;

        align-items: center !important;
    }

    .estrellas label {
        font-size: 16px !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    /* ==========================================
       SI / NO
       ========================================== */

    .opciones {
        display: flex !important;

        gap: 15px !important;

        align-items: center !important;
    }

    .opciones label {
        font-size: 10px !important;

        font-weight: normal !important;
    }

    /* ==========================================
       COMENTARIOS
       ========================================== */

    textarea {
        width: 100% !important;

        height: 40px !important;

        padding: 5px !important;

        font-size: 10px !important;

        resize: none !important;

        background: white !important;

        color: #222 !important;

        border: 1px solid #999 !important;

        border-radius: 3px !important;
    }

    /* ==========================================
       BOTONES
       ========================================== */

    .botones,
    button {
        display: none !important;
    }

    /* ==========================================
       PIE DE PÁGINA
       ========================================== */

    footer {
        width: 100% !important;

        margin: 4px 0 0 0 !important;

        padding: 7px !important;

        background: #f2f2f2 !important;

        color: #222 !important;

        text-align: center !important;

        font-size: 9px !important;

        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    footer p {
        margin: 2px !important;
    }

    /* ==========================================
       EVITAR SALTOS
       ========================================== */

    .encabezado,
    .formulario,
    .pregunta,
    section,
    footer {
        page-break-before: auto !important;
        page-break-after: auto !important;
        page-break-inside: avoid !important;

        break-before: auto !important;
        break-after: auto !important;
        break-inside: avoid !important;
    }
}