
/* ============================================
   FORMULARIO PRINCIPAL
   ============================================ */
.simulacion-form {
    width: 100%;
    max-width: 1024px;
    margin: 20px auto;
    padding: var(--spacing-md);
}

.form-container {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

/* ============================================
   ESTRUCTURA DE PREGUNTAS
   ============================================ */
.question-wrapper {
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp var(--transition-slow);
}

.question-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.question-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: var(--color-primary-light);
    border-radius: var(--border-radius-full);
    margin-right: var(--spacing-md);
}

.question-icon svg {
    width: 2rem;
    height: 2rem;
    stroke: var(--color-primary);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   CAMPOS - ESTILOS COMUNES
   ============================================ */
.field-container {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.field-label {
    display: block;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-gray-900);
    text-align: center;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.field-help {
    font-size: 0.875rem;
    color: var(--color-gray-700);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.field-error {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: #fee2e2;
    border: 1px solid var(--color-error);
    border-radius: var(--border-radius-sm);
    color: var(--color-error);
    font-size: 0.875rem;
}

/* ============================================
   INPUTS DE TEXTO, NÚMERO Y FECHA
   ============================================ */
.input-text,
.input-number,
.input-date {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
    text-align: center;
}

.input-text:focus,
.input-number:focus,
.input-date:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.input-text:invalid,
.input-number:invalid,
.input-date:invalid {
    border-color: var(--color-error);
}

.input-number {
    max-width: 20rem;
    margin: 0 auto;
    display: block;
}

/* ============================================
   CONSENT FIELD
   ============================================ */

.consent-container {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.consent-field {
    margin-bottom: 1rem;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 2rem;
    user-select: none;
}

.consent-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.consent-checkmark {
    position: absolute;
    left: 0;
    top: 0.125rem;
    height: 1.25rem;
    width: 1.25rem;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.consent-label:hover .consent-checkmark {
    border-color: var(--color-primary);
}

.consent-checkbox:checked ~ .consent-checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.consent-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 0.375rem;
    top: 0.125rem;
    width: 0.375rem;
    height: 0.625rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-checkbox:checked ~ .consent-checkmark:after {
    display: block;
}

.consent-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.consent-link {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.consent-link:hover {
    color: var(--color-primary-dark);
}

.consent-errors {
    margin-top: 0.5rem;
    padding-left: 2rem;
}

.consent-error {
    display: block;
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.consent-checkbox:invalid ~ .consent-checkmark {
    border-color: #dc2626;
}

.consent-info {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 0.25rem;
}

.consent-info-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: #3b82f6;
}

.consent-info-text {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #1e40af;
}

.consent-intro {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.consent-intro__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin: 0 0 var(--spacing-md) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.consent-intro__title::before {
    content: "🔒";
    font-size: 1.25rem;
}

.consent-intro__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--spacing-sm);
}

.consent-intro__item {
    position: relative;
    padding-left: 1.75rem;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.consent-intro__item::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ============================================
   RADIO BUTTONS - GRID CON IMÁGENES
   ============================================ */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 75px);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.radio-panel {
    position: relative;
    padding: var(--spacing-xs);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--border-radius-lg);
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
}

.radio-panel:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.radio-panel--selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.radio-panel__image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius-md);
}

.radio-panel__label {
    display: block;
    font-weight: 600;
    color: var(--color-gray-900);
}

.radio-panel__checkmark {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--color-primary);
    border-radius: var(--border-radius-full);
    display: none;
    align-items: center;
    justify-content: center;
}

.radio-panel--selected .radio-panel__checkmark {
    display: flex;
}

.checkmark-icon {
    width: 1rem;
    height: 1rem;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   RADIO BUTTONS - LISTA TRADICIONAL
   ============================================ */
.radio-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.radio-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.radio-item:hover {
    border-color: var(--color-primary);
    background: var(--color-gray-50);
}

.radio-item--selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.radio-item input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: var(--spacing-md);
    accent-color: var(--color-primary);
}

.radio-item__label {
    font-weight: 500;
    color: var(--color-gray-900);
}

/* ============================================
   DROPDOWN
   ============================================ */
.field-dropdown {
    margin-top: var(--spacing-lg);
}

.dropdown-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: var(--spacing-sm);
}

.dropdown-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: white;
    cursor: pointer;
}

.dropdown-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ============================================
   BOOLEAN (SÍ/NO)
   ============================================ */
.boolean-group {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.boolean-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1.125rem;
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 8rem;
}

.boolean-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.boolean-btn__icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: var(--spacing-sm);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.boolean-btn--yes:hover {
    border-color: var(--color-success);
}

.boolean-btn--yes.boolean-btn--active {
    border-color: var(--color-success);
    background: #d1fae5;
    color: var(--color-success);
}

.boolean-btn--yes .boolean-btn__icon {
    stroke: currentColor;
}

.boolean-btn--no:hover {
    border-color: var(--color-error);
}

.boolean-btn--no.boolean-btn--active {
    border-color: var(--color-error);
    background: #fee2e2;
    color: var(--color-error);
}

.boolean-btn--no .boolean-btn__icon {
    stroke: currentColor;
}

/* ============================================
   NAVEGACIÓN DEL FORMULARIO
   ============================================ */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-2xl);
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

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

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

.btn-primary {
    background: var(--color-secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-secondary-dark);
}

.btn-secondary {
    background: var(--color-gray-200);
    color: var(--color-gray-900);
}

.btn-secondary:hover {
    background: var(--color-gray-300);
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-primary .btn-icon {
    margin-left: var(--spacing-sm);
}

.btn-secondary .btn-icon {
    margin-right: var(--spacing-sm);
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .field-label {
        font-size: 1.5rem;
    }
    
    .radio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .boolean-btn {
        width: 100%;
    }
    
    .form-navigation {
        flex-direction: column-reverse;
        gap: var(--spacing-md);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }

    .form-container {
        padding: var(--spacing-xs);
    }

    .question-wrapper {
        margin-bottom: var(--spacing-md);
    }

    .field-container {
        padding: 0 var(--spacing-sm);
    }

    .form-navigation {
        margin-top: var(--spacing-md);
    }
}

/* ============================================
   UTILIDADES
   ============================================ */
.hidden {
    display: none !important;
}

.corredor-selector {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--color-gray-50);
    border-radius: var(--border-radius-lg);
}


/* ============================================
   INFO BOX (usuarios de prueba)
   ============================================ */
.info-box {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
}

.info-box__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.info-box__icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.info-box__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.info-box__list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.info-box__list li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--color-border);
}

.info-box__list li:last-child {
    border-bottom: none;
}

.info-box__list strong {
    color: var(--color-text);
    font-weight: 600;
}


/* ============================================
   LOGIN FORM
   ============================================ */
.login-form {
    width: 100%;
}

.field-group {
    margin-bottom: var(--spacing-md);
}

.field-label--small {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* Password input con botón de toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .input-text {
    padding-right: 3rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: color var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--color-primary);
}

.password-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================================
   ALERTAS
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
}

.alert--error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert--success {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert--info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}


/* ============================================
   CORREDOR INFO COMPONENT
   ============================================ */

.corredor-info-container {
    margin: var(--spacing-xl) 0;
    animation: fadeIn 0.5s ease-out;
}

/* Estado inicial: Prompt */
.corredor-prompt {
    text-align: center;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px dashed var(--color-primary);
    border-radius: var(--border-radius-lg);
}

.corredor-prompt__icon {
    display: inline-flex;
    padding: var(--spacing-md);
    background: white;
    border-radius: 50%;
    margin-bottom: var(--spacing-md);
}

.corredor-prompt__icon svg {
    width: 2rem;
    height: 2rem;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.corredor-prompt__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--spacing-sm) 0;
}

.corredor-prompt__text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

/* Estado con corredor: Resultado */
.corredor-result {
    padding: var(--spacing-lg);
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.5s ease-out;
}

.corredor-result__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.corredor-result__icon {
    display: flex;
    padding: 0.5rem;
    background: #dcfce7;
    border-radius: 50%;
}

.corredor-result__icon svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: #16a34a;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.corredor-result__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.corredor-result__subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0 0 var(--spacing-lg) 0;
}

/* Card del corredor */
.corredor-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
}

.corredor-card__logo-wrapper {
    flex: 0 0 5rem;
    width: 5rem;
    height: 5rem;
    background: white;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

.corredor-card__logo {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.corredor-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.corredor-card__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.corredor-card__badge {
    display: flex;
    align-items: center;
}

.corredor-card__badge img {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

/* ============================================
   RECAPTCHA FIELD
   ============================================ */

.field-container--recaptcha {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0;
}

.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
}

/* Centrar el iframe de reCAPTCHA */
.recaptcha-wrapper > div {
    display: inline-block;
    margin: 0 auto;
}

/* Estilos específicos para el widget de Google reCAPTCHA */
.recaptcha-wrapper .g-recaptcha {
    display: inline-block;
}

.recaptcha-wrapper iframe {
    margin: 0 auto;
    display: block;
}

/* Error centrado */
.field-error--centered {
    text-align: center;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--spacing-md);
}

/* Estado de carga */
.recaptcha-wrapper::before {
    content: '';
    display: none;
    width: 304px;
    height: 78px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius-md);
}