/* Estilos personalizados para el formulario */

body {
    background-image: url('../../img/bg-capellansf.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 10px;
    border: none;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #7158e2 0%, #5b3cc4 100%);
    border-bottom: none;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    font-weight: 600;
    color: #495057;
}

.form-control {
    border-radius: 6px;
    padding: 10px 12px;
    border: 1px solid #dce4ec;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #5b3cc4;
    box-shadow: 0 0 0 0.2rem rgba(91, 60, 196, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #7158e2 0%, #5b3cc4 100%);
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5b3cc4 0%, #4a2fa5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(91, 60, 196, 0.3);
}

.text-danger {
    font-size: 0.85rem;
    margin-top: 5px;
}

.invalid-feedback {
    font-size: 0.85rem;
}

/* Estilos para Choices.js */
.choices {
    margin-bottom: 0;
    position: relative;
}

.choices__inner {
    min-height: 44px;
    background-color: #fff;
    border: 1px solid #dce4ec;
    border-radius: 6px;
    padding-right: 55px !important; /* Espacio para el cuadro de validación */
}

.choices__list--dropdown {
    border-radius: 6px;
    border: 1px solid #dce4ec;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999 !important; /* Asegura que aparezca sobre otros elementos */
    position: absolute;
    width: 100%;
}

.choices__list--single {
    padding: 3px 16px 3px 12px;
}

.choices__list--dropdown .choices__item--selectable {
    padding: 8px 12px;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #5b3cc4 !important;
    color: #fff !important;
}

/* Asegurar texto visible en todos los elementos de las listas */
.choices__list--dropdown .choices__item {
    color: #333 !important;
}

/* Al pasar el cursor, texto blanco solo si el fondo es oscuro */
.choices__list--dropdown .choices__item:hover,
.choices__list--dropdown .choices__item--selectable:hover {
    background-color: #f2f2f2;
    color: #333 !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted:hover {
    background-color: #5b3cc4 !important;
    color: #fff !important;
}

/* Asegurar que el contenedor del formulario permite el desbordamiento */
.card-body {
    overflow: visible !important;
}

/* Nuevo estilo para el ícono de validación como cuadrito */
.validation-icon {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 40px;
    display: none; /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    border-left: 1px solid #dce4ec;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    z-index: 5;
}

.validation-icon-valid {
    background-color: #198754;
    color: white;
    display: flex;
}

.validation-icon-invalid {
    background-color: #dc3545;
    color: white;
    display: flex;
}

.choices-container {
    position: relative;
    margin-bottom: 1rem;
}

.choices-container .validation-icon {
    top: 1px;
    height: calc(100% - 2px);
    right: 1px;
}

/* Estilo para un campo inválido */
.is-invalid-choice .choices__inner {
    border-color: #dc3545 !important;
    border-width: 2px !important;
}

/* Estilo para un campo válido */
.is-valid-choice .choices__inner {
    border-color: #198754 !important;
    border-width: 2px !important;
}

/* Estilos específicos para mejorar la visibilidad de texto */
.choices__list--dropdown .choices__item {
    position: relative;
    display: block;
    padding: 10px !important;
    font-size: 14px;
    font-weight: normal;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Asegurar contraste adecuado */
.choices-dropdown-nacionalidad .choices__item,
.choices-dropdown-estado-civil .choices__item {
    background-color: #ffffff;
}

/* Estilo específico para el elemento actualmente seleccionado */
.choices__list--dropdown .choices__item--selectable.is-selected {
    background-color: #f5f5f5;
    color: #333 !important;
}

/* Dar mayor especificidad al estilo de hover */
.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #5b3cc4 !important;
    color: #fff !important;
    font-weight: 500;
}

/* Animaciones para feedback de validación */
.animate__animated.animate__headShake {
    animation-duration: 0.75s;
}

/* Estilo para el campo requerido */
.campo-requerido::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

/* Indicador de fortaleza de contraseña */
.password-strength {
    height: 5px;
    margin-top: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background-color: #dc3545;
    width: 33%;
}

.password-strength.medium {
    background-color: #ffc107;
    width: 66%;
}

.password-strength.strong {
    background-color: #28a745;
    width: 100%;
}
