/* Reset y variables */
:root {
    --primary-color: #005CB9;
    --primary-dark: #004fa0;
    --primary-light: #0066cc;
    --secondary-color: #3c3c3c;
    --text-color: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --bg-color: #f8f9fa;
    --bg-white: #ffffff;
    --error-color: #dc3545;
    --success-color: #28a745;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

h3 {
    font-size: 24px;
    font-weight: 600;
}

/* Contenedor principal */
.x_contenido {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

.x_cuadro1 {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    margin: 0 auto;
}

/* Header del formulario */
.x_header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.x_subtitle {
    color: var(--text-light);
    font-size: 16px;
    margin-top: 8px;
    font-weight: 400;
}

/* Secciones */
.x_section_divider {
    margin: 40px 0 25px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.x_section_divider h2 {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 600;
}

/* Campos del formulario */
.x_subcuadro {
    margin-bottom: 24px;
    width: 100%;
}

.x_label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.x_subtitulo {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.x_campo_obligatorio {
    color: var(--error-color);
    font-weight: 600;
    margin-left: 4px;
}

/* Grupos de input */
.x_input_group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.x_input_group select,
.x_input_group input {
    flex: 1;
}

/* Inputs, selects y textareas */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 92, 185, 0.1);
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
select:hover,
textarea:hover {
    border-color: #adb5bd;
}

input::placeholder,
textarea::placeholder {
    color: #adb5bd;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    min-height: 100px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
}

/* Botones de ayuda */
.question {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.question:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.question:active {
    transform: scale(0.95);
}

/* Botón de envío */
.enviar {
    width: 100%;
    padding: 16px 24px;
    height: auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    font-family: 'Inter', sans-serif;
}

.enviar:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.enviar:active {
    transform: translateY(0);
}

.enviar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    display: inline-block;
}

.button-icon {
    font-size: 20px;
    transition: var(--transition);
}

.enviar:hover .button-icon {
    transform: translateX(4px);
}

/* Colores */
.x_colores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.x_color {
    padding: 12px 8px;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 500;
    border: 3px solid transparent;
    box-shadow: var(--shadow-sm);
}

.x_color:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.x_color small {
    display: block;
    font-size: 10px;
    opacity: 0.9;
    margin-top: 4px;
}

.x_color_custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    border: 3px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.x_color_custom:hover {
    background: #e9ecef;
    border-color: var(--border-color);
}

.x_color_custom label {
    font-size: 13px;
    color: var(--text-color);
    font-weight: 500;
    margin: 0;
    cursor: pointer;
}

.x_color_input {
    width: 60px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    transition: var(--transition);
}

.x_color_input:hover {
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-sm);
}

/* Modal overlay para ayuda */
.x_modal_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.x_modal_overlay.active {
    display: flex;
}

.x_modal_content {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    padding: 30px;
    margin: 20px;
}

@media only screen and (max-width: 768px) {
    .x_modal_content {
        padding: 25px 20px;
        margin: 15px;
        width: 95%;
    }
}

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

.x_modal_close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

.x_modal_close:hover {
    background: #e9ecef;
    transform: scale(1.1);
    color: var(--error-color);
}

#x_modal_body {
    width: 100%;
}

#x_modal_body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

#x_modal_body b {
    display: block;
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 600;
}

#x_modal_body p {
    margin: 12px 0;
    line-height: 1.6;
    color: var(--text-color);
}

/* Captcha */
.x_captcha_container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    margin: 30px 0;
}

#x_captcha {
    display: flex;
    justify-content: center;
}

/* Contenedor de envío */
.x_submit_container {
    margin-top: 30px;
    position: relative;
}

#x_esperar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

#x_esperar img {
    width: 40px;
    height: 40px;
}

/* Validación - solo mostrar error cuando hay validación activa */
input.error,
select.error {
    border-color: var(--error-color);
}

/* Responsive */
@media only screen and (max-width: 768px) {
    .x_contenido {
        padding: 30px 15px;
    }

    .x_cuadro1 {
        padding: 25px 20px;
    }

    h1 {
        font-size: 24px;
    }

    .x_subtitle {
        font-size: 14px;
    }

    .x_colores {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .x_div_ejemplo {
        max-width: 100%;
    }

    .x_input_group {
        flex-direction: column;
    }

    .question {
        width: 100%;
        border-radius: var(--radius-sm);
        height: 40px;
    }
}

@media only screen and (max-width: 480px) {
    .x_contenido {
        padding: 20px 10px;
    }

    .x_cuadro1 {
        padding: 20px 15px;
    }

    h1 {
        font-size: 20px;
    }

    .x_header {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .x_colores {
        grid-template-columns: 1fr;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Animaciones suaves */
.x_subcuadro {
    animation: fadeIn 0.5s ease;
}

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

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

