* {
    box-sizing: border-box;
}

/* SOLUCIÓN PARA EVITAR SALTO LATERAL */
html {
    overflow-y: scroll;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #d9dde2;
    color: #1f2430;
}

.encuesta-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 0;
}

.encuesta-card {
    width: 100%;
    max-width: 820px;
    background: #efefef;
    min-height: 100vh;
}

.step {
    display: none;
}

.step-active {
    display: block;
}

/* Alinear el botón de la pantalla 1 al fondo */
#step-1.step-active {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 100px);
    padding-top: 50px;
}

/* Alinear los botones de la pantalla 2 al fondo */
#step-2.step-active {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 100px);
}

.top-bar {
    width: 100%;
    height: 100px;
    background: #2f3c5f;
    display: flex;
    align-items: center;
    padding-left: 16px;
}

.top-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-wrap {
    width: 100%;
    margin: 0;
}

.logo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.intro-title {
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    margin: 50px 30px 30px;
}

.curso-codigo {
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    margin-top: 90px;
}

.curso-nombre {
    text-align: center;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 400;
    margin: 16px 32px 0;
    text-transform: uppercase;
}

.intro-box {
    margin: 140px 40px 25px;
    font-size: 18px;
    line-height: 1.45;
}

.intro-box p {
    margin: 0 0 22px;
}

.formulario-encuesta {
    padding: 80px 28px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.question-block {
    margin-bottom: 34px;
}

.question-label {
    display: block;
    font-size: 16px;
    line-height: 1.1;
    margin-bottom: 18px;
    font-weight: 400;
}

.rating {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.rating input {
    display: none;
}

.rating label {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    position: relative;
    clip-path: polygon(
        50% 0%,
        61% 35%,
        98% 35%,
        68% 57%,
        79% 91%,
        50% 70%,
        21% 91%,
        32% 57%,
        2% 35%,
        39% 35%
    );
    background: #2f3c5f;
    transition: all 0.2s ease;
}

.rating label:hover {
    background: #3f4d78;
}

.rating input:checked + label {
    background: #cda93a;
}

.textarea-observaciones {
    width: 100%;
    min-height: 230px;
    margin-bottom: 100px;
    border: 6px solid #e4e4e4;
    border-radius: 14px;
    background: #f7f7f7;
    padding: 16px;
    font-size: 16px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: #888;
    resize: vertical;
}

.actions-row {
    display: flex;
    gap: 24px;
    margin-top: auto;
    margin-bottom: 50px;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 22px 24px;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
}

.btn-full {
    width: calc(100% - 40px);
    margin: auto 20px 40px;
}

.btn-primary {
    background: #6467dd;
    color: white;
}

.btn-secondary {
    flex: 1;
    background: #59aeb4;
    color: white;
}

.btn-success {
    flex: 1;
    background: #58aa4f;
    color: white;
}

.gracias-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
}

.gracias-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.gracias-footer {
    padding: 0 20px 25px;
}

.gracias-footer .btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 auto;
    text-align: center;
    text-decoration: none;
}

.gracias-titulo {
    font-size: 40px;
    margin-bottom: 20px;
    font-weight: 700;
}

.gracias-texto {
    font-size: 22px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .top-bar {
        height: 72px;
        padding-left: 12px;
    }

    .top-logo {
        height: 34px;
    }

    #step-1.step-active {
        min-height: calc(100vh - 72px);
        padding-top: 45px;
    }

    #step-2.step-active {
        min-height: calc(100vh - 72px);
    }

    .logo-wrap {
        width: 100%;
        margin: 0;
    }

    .logo {
        width: 100%;
        height: 130px;
        object-fit: cover;
        object-position: center;
        display: block;
    }

    .intro-title {
        font-size: 22px;
        margin: 18px 18px 12px;
    }

    .curso-codigo {
        font-size: 18px;
        margin-top: 20px;
    }

    .curso-nombre {
        font-size: 20px;
        line-height: 1.15;
        margin: 8px 18px 0;
    }

    .intro-box {
        margin: 30px 18px 16px;
        font-size: 15px;
        line-height: 1.32;
    }

    .intro-box p {
        margin: 0 0 10px;
    }

    .formulario-encuesta {
        padding: 32px 18px 20px;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .question-block {
        margin-bottom: 24px;
    }

    .question-label {
        font-size: 16px;
        line-height: 1.2;
        margin-bottom: 12px;
    }

    .rating {
        gap: 4px;
        margin-top: 6px;
    }

    .rating label {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .textarea-observaciones {
        min-height: 140px;
        margin-bottom: 40px;
        padding: 12px;
        font-size: 16px;
        border-width: 4px;
    }

    .actions-row {
        gap: 14px;
        margin-top: auto;
        margin-bottom: 24px;
    }

    .btn {
        font-size: 18px;
        padding: 14px 16px;
        border-radius: 12px;
    }

    .btn-full {
        width: calc(100% - 36px);
        margin: auto 18px 24px;
        font-size: 18px;
        padding: 14px 16px;
    }

    .gracias-container {
        height: calc(100vh - 72px);
    }

    .gracias-content {
        padding: 18px;
    }

    .gracias-titulo {
        font-size: 30px;
        margin-bottom: 14px;
    }

    .gracias-texto {
        font-size: 17px;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .gracias-footer {
        padding: 0 18px 20px;
    }

    .gracias-footer .btn {
        width: calc(100% - 36px);
        font-size: 18px;
        padding: 14px 16px;
    }
}