/* ==========================================================================
   --- FORMULARIO DE CALIFICACIÓN: SISTEMA ESCALABLE PROPORCIONAL (MyPI v2) ---
   ========================================================================== */

.mypi-v2-container {
    /* ==========================================================================
       PUNTO DE CONTROL MAESTRO: 
       Cambia este único valor de abajo (ej: 16px, 18px, 20px, 22px) 
       y TODO el formulario (textos, paddings, botones) se escalará proporcionalmente.
       ========================================================================== */
    font-size: 18px; 
    
    --mypi-primary: #6866e1;
    --mypi-secondary: #f0f0f5;
    --mypi-success: #28a745;
    --mypi-text: #19104d;
    --mypi-text-muted: #3a3a5a;
    --mypi-border: #dcdce6;
    max-width: 750px;
    margin: 20px auto;
    font-family: "Raleway", sans-serif;
    box-sizing: border-box;
}

.mypi-v2-container * {
    box-sizing: border-box;
}

/* Tarjeta Principal del Formulario */
.mypi-v2-form {
    background: #ffffff;
    padding: 2.2em; /* Equivalente proporcional a padding */
    border-radius: 1em;
    box-shadow: 0 0.6em 1.8em rgba(25, 16, 77, 0.08);
    border: 1px solid var(--mypi-border);
}

/* Títulos de cada Paso (Proporcional) */
.mypi-step-title {
    color: var(--mypi-text);
    font-size: 2.2em; /* 2.2 veces el tamaño base */
    font-weight: 800;
    margin: 0 0 1.2em 0;
    padding-bottom: 0.6em;
    border-bottom: 0.1em solid var(--mypi-secondary);
    line-height: 1.2;
}

/* Campos de entrada y Labels (Proporcionales) */
.mypi-field {
    margin-bottom: 1.4em;
    position: relative;
    text-align: left;
}

.mypi-field label {
    display: block;
    font-weight: 700;
    color: var(--mypi-text);
    margin-bottom: 0.5em;
    font-size: 1.15em; /* Proporcional */
    line-height: 1.4;
}

.mypi-field input[type="text"],
.mypi-field input[type="email"],
.mypi-field select,
.mypi-field textarea {
    width: 100%;
    padding: 0.8em 1em; /* Paddings adaptativos */
    border: 0.12em solid var(--mypi-secondary);
    border-radius: 0.5em;
    font-size: 1em; /* Adopta el tamaño base de forma exacta (18px) */
    color: #111;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.mypi-field input:focus, 
.mypi-field select:focus, 
.mypi-field textarea:focus {
    border-color: var(--mypi-primary);
    box-shadow: 0 0 0 0.25em rgba(104, 102, 225, 0.15);
    background: #fdfdfd;
}

.mypi-error input, .mypi-error select, .mypi-error textarea {
    border-color: #ff4d4d !important;
    background: #fff5f5 !important;
}

/* Autocompletado (Proporcional) */
.mypi-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 0.06em solid var(--mypi-border);
    border-top: none;
    z-index: 100;
    border-radius: 0 0 0.5em 0.5em;
    box-shadow: 0 0.5em 1.2em rgba(0,0,0,0.1);
    max-height: 12em;
    overflow-y: auto;
}

.mypi-suggestion {
    padding: 0.7em 1em;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--mypi-text);
    border-bottom: 0.06em solid #f8f8fa;
}

.mypi-suggestion:hover {
    background: var(--mypi-secondary);
    color: var(--mypi-primary);
}


/* --- SECCIÓN DE INSTRUCCIONES ACCESIBLES --- */
.mypi-instructions-box {
    border: 0.06em solid var(--mypi-border);
    border-radius: 0.75em;
    padding: 1.8em;
    background: #fafafa;
}

.mypi-instructions-content {
    font-size: 1em; /* Adopta el tamaño base (18px) */
    line-height: 1.7;
    color: var(--mypi-text-muted);
    margin-bottom: 1.8em;
}

.mypi-instructions-content ol {
    padding-left: 1.2em;
    margin: 0.9em 0;
}

.mypi-instructions-content li {
    margin-bottom: 0.7em;
}

.mypi-consent-text {
    font-weight: 800;
    color: var(--mypi-text);
    margin-top: 1.4em;
    font-size: 1.1em;
}

.mypi-radio-group {
    display: flex;
    gap: 1.5em;
    margin-top: 0.6em;
}

.mypi-radio-group label {
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.mypi-radio-group input[type="radio"] {
    transform: scale(1.3);
    accent-color: var(--mypi-primary);
}

.mypi-accept-field {
    margin-top: 1.8em;
    background: #fff;
    border: 0.12em solid var(--mypi-secondary);
    padding: 1.2em;
    border-radius: 0.5em;
    text-align: center;
}

.mypi-checkbox-label {
    cursor: pointer;
    font-size: 1.15em !important;
    font-weight: 800 !important;
    color: var(--mypi-primary) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
}

.mypi-checkbox-label input[type="checkbox"] {
    transform: scale(1.4);
    accent-color: var(--mypi-primary);
}


/* --- DEGRADADOS INTEGRADOS POR MÓDULO --- */

.mypi-theme-yellow {
    --mypi-theme-color: #f3c242;
    background: linear-gradient(135deg, #ffffff 0%, #fffdf2 100%) !important;
    border: 0.06em solid #f3c242 !important;
}
.mypi-theme-yellow .mypi-options-vertical label:has(input:checked) {
    background: linear-gradient(135deg, #f3c242 0%, #f6d275 100%) !important;
    border-color: #f3c242 !important;
    color: #ffffff !important;
}

.mypi-theme-green {
    --mypi-theme-color: #52af6a;
    background: linear-gradient(135deg, #ffffff 0%, #f5fbf7 100%) !important;
    border: 0.06em solid #52af6a !important;
}
.mypi-theme-green .mypi-options-vertical label:has(input:checked) {
    background: linear-gradient(135deg, #52af6a 0%, #76c68a 100%) !important;
    border-color: #52af6a !important;
    color: #ffffff !important;
}

.mypi-theme-blue {
    --mypi-theme-color: #29b2b5;
    background: linear-gradient(135deg, #ffffff 0%, #f0fbfc 100%) !important;
    border: 0.06em solid #29b2b5 !important;
}
.mypi-theme-blue .mypi-options-vertical label:has(input:checked) {
    background: linear-gradient(135deg, #29b2b5 0%, #51cbd0 100%) !important;
    border-color: #29b2b5 !important;
    color: #ffffff !important;
}

.mypi-theme-purple {
    --mypi-theme-color: #827dc7;
    background: linear-gradient(135deg, #ffffff 0%, #f7f6fd 100%) !important;
    border: 0.06em solid #827dc7 !important;
}
.mypi-theme-purple .mypi-options-vertical label:has(input:checked) {
    background: linear-gradient(135deg, #827dc7 0%, #a29ee2 100%) !important;
    border-color: #827dc7 !important;
    color: #ffffff !important;
}


/* --- PREGUNTAS DEL MÓDULO --- */
.mypi-step[class*="mypi-theme-"] .mypi-step-title {
    color: var(--mypi-theme-color);
    border-bottom-color: var(--mypi-theme-color);
}

.mypi-step[class*="mypi-theme-"] .mypi-question-card {
    background: #ffffff;
    border-left: 0.3em solid var(--mypi-theme-color);
    box-shadow: 0 0.25em 1em rgba(0,0,0,0.03);
    padding: 1.5em;
    border-radius: 0.5em;
    margin-bottom: 1.5em;
}

.mypi-step[class*="mypi-theme-"] .mypi-question-card p {
    margin: 0 0 1.1em 0;
    font-weight: 700;
    font-size: 1.1em; /* Proporcional */
    color: var(--mypi-text);
    line-height: 1.5;
}

/* Opciones Verticales */
.mypi-options-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.mypi-options-vertical label {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 1em 1.5em; /* Padding proporcional */
    border-radius: 0.5em;
    cursor: pointer;
    font-size: 0.95em; /* Proporcional */
    transition: all 0.25s ease;
    border: 0.12em solid var(--mypi-secondary);
    color: var(--mypi-text);
    font-weight: 600;
    line-height: 1.4;
}

.mypi-options-vertical input[type="radio"] {
    margin-right: 1em;
    transform: scale(1.3);
    accent-color: var(--mypi-theme-color);
}

.mypi-step[class*="mypi-theme-"] .mypi-options-vertical label:hover:not(:has(input:checked)) {
    border-color: var(--mypi-theme-color);
    background: var(--mypi-theme-hover);
}


/* --- BOTONES Y COMPORTAMIENTO FLEX --- */
.mypi-flex {
    display: flex;
    gap: 1em;
    margin-top: 1.8em;
}

.mypi-v2-btn {
    flex: 1;
    padding: 1em 1.5em; /* Botones proporcionales */
    border-radius: 0.6em;
    border: none;
    font-weight: bold;
    font-size: 1em; /* Proporcional */
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    text-align: center;
}

.mypi-v2-btn:active { transform: scale(0.98); }
.mypi-v2-btn.secondary { background: var(--mypi-secondary); color: var(--mypi-text); }
.mypi-v2-btn.success { background: var(--mypi-success); color: white; }
.mypi-v2-btn:not(.secondary):not(.success) { background: var(--mypi-primary); color: white; }


/* ==========================================================================
   --- MEDIA QUERIES: MANTIENEN LA PROPORCIÓN AUTOMÁTICA EN MÓVILES ---
   ========================================================================== */

@media (max-width: 768px) {
    .mypi-v2-container {
        font-size: 16px; /* Escalado automático para tablets */
    }
}

@media (max-width: 480px) {
    .mypi-v2-container {
        font-size: 15px; /* Escalado automático para celulares */
    }
    .mypi-v2-form {
        padding: 1em; 
        border-radius: 0.75em;
        box-shadow: none; 
        border: none; 
    }
    .mypi-radio-group {
        flex-direction: column; 
        gap: 0.75em;
    }
    .mypi-flex {
        flex-direction: column-reverse; 
        gap: 0.6em;
    }
    .mypi-v2-btn {
        width: 100%;
        padding: 0.9em;
    }
    .mypi-options-vertical label {
        padding: 0.8em 1em;
    }
}