/* ============================================
   SOLICITUD DE PRÉSTAMO - ESTILOS
   ============================================ */

/* Hero/Encabezado */
.hero-solicitud {
    background: #f9f7f2;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 3px solid var(--green-dark);
}

.hero-solicitud h1 {
    margin: 0;
    color: var(--green-dark);
    font-size: 2rem;
}

/* Sección principal del formulario */
.section-solicitud {
    padding: 50px 20px;
    background: var(--white);
}

/* ============================================
   ESTILOS DEL FORMULARIO
   ============================================ */

.formulario-solicitud {
    max-width: 1000px;
    margin: 0 auto;
}

/* Fieldsets (secciones) */
.formulario-section {
    border: none;
    padding: 0 0 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

.formulario-section:last-of-type {
    border-bottom: none;
}

.formulario-section legend {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 25px;
    padding: 0;
}

/* ============================================
   GRUPOS DE FORMULARIO
   ============================================ */

.form-group {
    margin-bottom: 25px;
}

/* 2 columnas */
.form-group--2cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 3 columnas */
.form-group--3cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* Campo individual */
.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1rem;
}

/* ============================================
   INPUTS Y TEXTAREAS
   ============================================ */

.form-field input,
.form-field select,
.form-field textarea {
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    transition: 0.3s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(35, 92, 61, 0.1);
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   SELECTOR DE TELÉFONO
   ============================================ */

.input-con-selector {
    display: flex;
    gap: 10px;
}

.selector-pais {
    flex: 0 0 120px;
    padding: 12px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.input-con-selector input {
    flex: 1;
}

/* ============================================
   RADIO BUTTONS
   ============================================ */

.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
}

.radio-item input {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-upload {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: 0.3s;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--green-dark);
    background: rgba(35, 92, 61, 0.05);
}

.file-upload.is-dragging {
    border-color: var(--green-dark);
    background: rgba(35, 92, 61, 0.1);
}

.file-upload input {
    display: none;
}

.file-upload p {
    margin: 0;
    color: var(--text-light);
    font-size: 1rem;
}

#file-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.file-preview-item {
    position: relative;
    width: 96px;
    text-align: center;
}

.file-preview-image {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
}

.file-preview-name {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #666;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove-file {
    position: absolute;
    top: -8px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.btn-remove-file:hover,
.btn-remove-file:focus-visible {
    background: #c0392b;
}

.btn-remove-file:focus-visible {
    outline: 3px solid rgba(35, 92, 61, 0.35);
    outline-offset: 2px;
}

/* ============================================
   BOTÓN ENVIAR
   ============================================ */

.form-group--submit {
    margin-top: 40px;
    text-align: center;
}

.btn-solicitud {
    background: var(--green-dark);
    color: var(--white);
    padding: 15px 50px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;  /* ← AGREGA ESTO */
}

.btn-solicitud:hover {
    background: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 92, 61, 0.2);
}

.btn-solicitud:active {
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 768px) {
    .form-group--2cols,
    .form-group--3cols {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .input-con-selector {
        flex-direction: column;
    }

    .selector-pais {
        flex: 1 1 100%;
    }

    .radio-group {
        flex-direction: column;
        gap: 15px;
    }

    .hero-solicitud h1 {
        font-size: 1.6rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 540px) {
    .section-solicitud {
        padding: 30px 15px;
    }

    .formulario-section legend {
        font-size: 1.1rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .file-upload {
        padding: 25px 15px;
    }

    #file-preview {
        gap: 12px;
    }

    .btn-solicitud {
        width: 100%;
        padding: 15px 20px;
    }
}

/* ============================================
   ESTILOS PARA LIBRERÍAS
   ============================================ */

/* Intl-Tel-Input */
.iti {
    width: 100%;
}

.iti__flag-container {
    background: var(--white);
}

.iti__selected-flag {
    padding: 0 8px;
    background: var(--white);
}

#telefono.iti {
    padding: 12px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

#telefono:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(35, 92, 61, 0.1);
}

/* Select2 */
.select2-container--default .select2-selection--single {
    border: 1px solid #ccc;
    border-radius: 6px;
    height: 44px;
    padding: 6px 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-dark);
    padding: 0;
    line-height: 32px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(35, 92, 61, 0.1);
}

.select2-dropdown {
    border: 1px solid #ccc;
    border-radius: 6px;
}

.select2-results__option--highlighted[aria-selected] {
    background: var(--green-dark);
}

/* Teléfono inválido */
#telefono.is-invalid {
    border-color: #e74c3c;
}