html {
    scroll-behavior: smooth;
}

select option {
    background: #333;
    color: #fff;
}

/* General Body Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #5a0b2f; /* Vino oscuro */
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-size: 18px; /* Aumentar tamaño de letra base */
}

/* Form Container with Glassmorphism Effect */
.form-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px 40px;
    width: 100%;
    max-width: 1000px; /* Aumentado para usar más espacio en PC */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.form-header h1 {
    text-align: center;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 2.5em; /* Título más grande */
}

.form-header .subtitle {
    text-align: center;
    font-weight: 300;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3em; /* Subtítulo más grande */
}

/* Iconos de acento */
.text-accent {
    color: #ff9a5a; /* Naranja-melocotón para contraste con fondo vino */
    margin-right: 8px;
    display: inline-block;
    transform: translateY(0);
    transition: all 0.3s ease;
}

/* Animación hover para iconos */
p:hover .text-accent, label:hover .text-accent {
    transform: translateY(-2px) scale(1.1);
    color: #ffcc5a; /* Amarillo más brillante al hacer hover */
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
    position: relative;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.progress-step {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    padding: 10px 0;
    transition: all 0.3s ease;
    z-index: 2;
    flex: 0 0 auto;
}

.progress-step i {
    font-size: 1.5em;
    margin-bottom: 5px;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.progress-step span {
    display: block;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.progress-step.active {
    color: #ffffff;
    font-weight: 500;
}

.progress-step.active i {
    color: #ff8c00;
    text-shadow: 0 0 15px rgba(255, 140, 0, 0.7);
    animation: pulse-icon 1.5s infinite alternate;
    transform: scale(1.2);
}

@keyframes pulse-icon {
    0% { transform: scale(1.2); }
    100% { transform: scale(1.4); }
}

/* Línea de progreso continua */
.progress-line {
    position: absolute;
    top: 70px; /* Bajamos más la línea para que esté completamente debajo del texto */
    left: 10%;
    right: 10%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    z-index: 1;
    margin-top: 10px; /* Espacio adicional desde el texto */
}

/* Puntos decorativos al inicio y final */
.progress-line::before, 
.progress-line::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.progress-line::before {
    left: -5px;
}

.progress-line::after {
    right: -5px;
}

.progress-line-inner {
    position: absolute;
    top: 0;
    .progress-line-top {
        height: 100%;
        background-color: #f7931e;
        width: 0;
        transition: width 0.4s ease;
    }
}

select option {
    background: #333;
    color: #fff;
}

/* Punto activo al final de la línea de progreso */
.progress-line-inner::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff8c00;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.7);
}

/* Actualizar el ancho según el paso activo */
.progress-step[data-step="1"].active ~ .progress-line .progress-line-inner {
    width: 0%;
}

.progress-step[data-step="2"].active ~ .progress-line .progress-line-inner {
    width: 33.33%;
}

.progress-step[data-step="3"].active ~ .progress-line .progress-line-inner {
    width: 66.66%;
}

.progress-step[data-step="4"].active ~ .progress-line .progress-line-inner {
    width: 100%;
}

/* Escala de evaluación animada */
.scale-indicator {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    margin-bottom: 30px;
    border-left: 4px solid #ff8c00;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 140, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 140, 0, 0.9);
    }
}

.scale-text {
    margin: 0;
    font-size: 1.1em;
    font-weight: 500;
}

.scale-value {
    font-weight: 400;
    color: #ff8c00;
    display: inline-block;
    animation: fadeInOut 3s infinite;
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.mobile-scale {
    display: none;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-step.active {
    display: block;
}

.step-title {
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.step-title i {
    margin-right: 10px;
    color: #ff8c00;
}

.eval-scale {
    text-align: center;
    margin-bottom: 25px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    display: none; /* Ocultamos esta versión ya que usaremos scale-indicator */
}

/* Form Groups and Inputs */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 1.1em;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
textarea:hover {
    background: rgba(255, 255, 255, 0.2);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
    background: rgba(255, 255, 255, 0.25);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Question Styling */
.question-group {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.question-group:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.question-group h3 {
    margin-top: 0;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 12px;
    margin-bottom: 25px;
    font-size: 1.5em;
    color: #ff8c00;
}

.question-group h3 i {
    margin-right: 10px;
}

.question {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question.answered {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.1);
}

.question p {
    margin: 0 0 15px 0;
    font-size: 1.1em;
}

/* Contenedor de selección y check */
.select-container {
    display: flex;
    align-items: center;
    position: relative;
}

/* Estilo para los select */
.rating-select {
    flex: 1;
    padding: 12px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    padding-right: 30px;
}

.rating-select:hover {
    background: rgba(255, 255, 255, 0.25);
}

.rating-select:focus {
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.5);
    border-color: #ff8c00;
}

/* Estilo para la flecha del select */
.select-container::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Animación de check cuando se selecciona */
.check-animation {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.check-animation.visible {
    opacity: 1;
    transform: scale(1);
}

.check-animation i {
    color: #2ecc71;
    font-size: 1.2em;
}

/* Clase para preguntas contestadas */
.question.answered .select-container::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: #ff8c00;
    border-radius: 2px;
}

/* Button Group */
.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn-primary {
    background-color: #ff8c00; /* Naranja */
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #e67e00;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn i {
    margin: 0 5px;
}

#prevBtn {
    display: none; /* Hidden by default */
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

/* Custom Popup Overlay */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Custom Popup Content */
.custom-popup-content {
    background: #36133f;
    color: white;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.custom-popup-content h2 {
    color: #f89d1d;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 20px;
}

.custom-popup-content p {
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.custom-popup-content button {
    background: linear-gradient(135deg, #f89d1d, #f15a24);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.custom-popup-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(248, 157, 29, 0.4);
}

.modal-content {
    background: rgba(90, 11, 47, 0.9); /* Fondo vino oscuro para el modal */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: 10% auto;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-top: 0;
    font-weight: 600;
    font-size: 2em;
    color: #ff8c00;
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.1em;
    margin-bottom: 25px;
}

.modal-content .btn {
    min-width: 150px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 16px;
    }

    .form-container {
        padding: 20px;
    }
    
    .form-header h1 {
        font-size: 1.8em;
    }
    
    .form-header .subtitle {
        font-size: 1.1em;
    }

    /* Estilos de barra de progreso para móvil */
    .progress-container {
        padding: 0 10px;
        margin-bottom: 15px;
    }
    
    .progress-steps {
        justify-content: center;
        gap: 25px;
    }
    
    .progress-step {
        margin: 0;
        padding: 5px 0;
    }
    
    .progress-step span {
        font-size: 0.7em;
        display: none; /* Ocultar texto en móvil */
    }
    
    .progress-step i {
        font-size: 1.2em;
        margin-bottom: 0;
    }
    
    /* Mostrar texto solo para el paso activo */
    .progress-step.active span {
        display: block;
        position: absolute;
        top: -18px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 140, 0, 0.2);
        padding: 2px 8px;
        border-radius: 4px;
        white-space: nowrap;
    }
    
    /* Ocultar línea en móvil */
    .progress-line {
        display: none;
    }

    /* Mostrar versión móvil de la escala */
    .scale-indicator:not(.mobile-scale) {
        display: none;
    }
    
    .mobile-scale {
        display: block;
        margin-bottom: 20px;
    }
    
    .scale-text {
        font-size: 0.9em;
    }

    .step-title {
        font-size: 1.5em;
    }
    
    .question-group h3 {
        font-size: 1.3em;
    }
    
    .question p {
        font-size: 1em;
    }

    .btn-group {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        margin-bottom: 15px;
        padding: 12px 20px;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Ajustes para selects en mobile */
    .select-container {
        flex-direction: column;
    }
    
    .select-container::after {
        right: 15px;
    }
    
    .check-animation {
        position: absolute;
        right: -10px;
        top: -10px;
        margin: 0;
    }
    
    .rating-select {
        width: 100%;
    }
}
