
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}


.contenedor-formulario {
    max-width: 700px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.encabezado {
    text-align: center;
    margin-bottom: 35px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 20px;
}

.encabezado h1 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.encabezado p {
    color: #764ba2;
    font-size: 1.1em;
    font-style: italic;
}


fieldset {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f9f9f9;
}

legend {
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    padding: 0 10px;
    margin-left: -10px;
}


.grupo-campo {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.grupo-campo.checkbox {
    flex-direction: row;
    align-items: center;
}


label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
    text-transform: capitalize;
}

.label-checkbox {
    margin-bottom: 0;
    margin-left: 10px;
    font-weight: 400;
    font-size: 0.9em;
}


input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:focus {
    border-color: #667eea;
}


.rango-contenedor {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #764ba2;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #764ba2;
}

#valor-ansiedad {
    min-width: 30px;
    padding: 5px 10px;
    background-color: #667eea;
    color: white;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
}


small {
    color: #999;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}


textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}


.grupo-botones {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    justify-content: center;
}


.boton {
    padding: 14px 35px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}


.boton-enviar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.boton-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.boton-enviar:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}


.boton-limpiar {
    background-color: #e0e0e0;
    color: #333;
    flex: 1;
}

.boton-limpiar:hover {
    background-color: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.boton-limpiar:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}


select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}


@media (max-width: 768px) {
    .contenedor-formulario {
        padding: 25px;
        border-radius: 10px;
    }

    .encabezado h1 {
        font-size: 1.6em;
    }

    .encabezado p {
        font-size: 1em;
    }

    .grupo-botones {
        flex-direction: column;
        gap: 10px;
    }

    .boton {
        width: 100%;
    }

    fieldset {
        padding: 15px;
        margin-bottom: 20px;
    }

    legend {
        font-size: 1.1em;
    }

    .rango-contenedor {
        flex-direction: column;
        align-items: stretch;
    }

    #valor-ansiedad {
        text-align: center;
    }
}


input:required::after,
select:required::after,
textarea:required::after {
    content: "*";
    color: #e74c3c;
    margin-left: 5px;
}


input:valid,
select:valid,
textarea:valid {
    border-color: #27ae60;
}

input:invalid,
select:invalid,
textarea:invalid {
    border-color: #e74c3c;
}
