
/* Estilos generales del body */
body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    position: relative;
}

/* Aplicar Poppins a todos los elementos */
* {
    font-family: 'Poppins', sans-serif;
}

/* Estilos específicos para diferentes elementos */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

input, select, textarea, button {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* Patrón sutil de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23dee2e6" fill-opacity="0.1"><circle cx="30" cy="30" r="1.5"/></g></svg>') repeat;
    z-index: -1;
}

/* Container principal limpio - Layout de dos columnas en desktop */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 40px 30px;
    min-height: 500px;
    background: #f8f9fa;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    /*animation: backgroundShift 20s ease-in-out infinite; */
}

/* Encabezado principal fuera de las columnas */
.main-header {
    text-align: center;
    margin-bottom: 40px;
}

.main-header h2 {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #495057;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Encabezado estilizado para la página de login del dashboard */
.dash-login-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    border-radius: 20px 20px 0 0;
    padding: 1.25rem 1rem;
    text-align: center;
}
.dash-login-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dash-login-header small {
    color: rgba(255,255,255,0.9);
    display: block;
    margin-top: 6px;
    font-weight: 500;
}

/* Layout de dos columnas para desktop */
.main-content {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    min-height: 500px;
}

.image-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.form-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Contenedor de imagen mejorado para desktop */
.img-container {
    text-align: center;
    margin-bottom: 0;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.img-container img {
    max-width: 100%;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-container img:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Estilos mejorados para el formulario en desktop */
#formulario {
    max-width: none;
    margin: 0;
    position: relative;
    width: 100%;
}

/* Eliminar el título anterior del formulario */
#formulario::before {
    display: none;
}

/* Campos del formulario mejorados */
.form-control, .form-select {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transform: translateY(-1px);
    outline: none;
}

.form-control::placeholder {
    color: #6c757d;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.form-control:focus::placeholder {
    opacity: 0.7;
}

/* Grupo de input de teléfono */
.phone-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.country-code {
    flex: 0 0 140px;
    min-width: 140px;
}

.phone-number {
    flex: 1;
}

/* Iconos para los campos */
.mb-3 {
    position: relative;
    margin-bottom: 25px !important;
}

/* Estilos para checkbox de autorización - header fuera del card */
.checkbox-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid #007bff;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #007bff;
    outline: none;
}

.checkbox-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    flex: 1;
}

/* Card solo para la descripción */
.form-check {
    padding: 16px 20px;
    /* Fondo fijo para evitar que la tarjeta cambie de color cuando el body tiene una animaci f3n */
    background-color: #f8f9fa; /* color fijo, sin animaci f3n */
    border-radius: 12px;
    border: 2px solid rgba(222, 226, 230, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    /* Asegurar que no haya animaci f3n aplicada a esta tarjeta */
    animation: none !important;
    -webkit-animation: none !important;
}

.form-check:hover {
    border-color: #007bff;
    /* Hover con leve cambio, sigue siendo un color fijo */
    background-color: #f0f8ff;
}

.checkbox-description {
    font-size: 14px;
    line-height: 1.5;
    color: #6c757d;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.checkbox-description strong {
    color: #dc3545;
    font-weight: 600;
}

/* Botón de envío mejorado con colores corporativos azules */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
    width: 100%;
    text-transform: none;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.4);
    color: #ffffff;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    color: #ffffff;
}

/* Footer optimizado para mobile y desktop */
footer {
    margin-top: 50px;
    text-align: center;
    background: #f8f9fa;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: #6c757d;
    font-weight: 500;
    border-top: 3px solid #dc3545;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc3545 0%, #007bff 50%, #dc3545 100%);
    background-size: 200% 100%;
    /* animation: gradientShift 3s ease-in-out infinite; */
}

footer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Animaciones suaves */
.container {
    animation: fadeInUp 0.8s ease-out;
}

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

/* Efectos de entrada para los campos */
.form-control, .form-select {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-control:nth-child(1) { animation-delay: 0.1s; }
.form-control:nth-child(2) { animation-delay: 0.2s; }
.form-control:nth-child(3) { animation-delay: 0.3s; }
.form-control:nth-child(4) { animation-delay: 0.4s; }
.form-select { animation-delay: 0.5s; }
.btn-primary { animation: slideInUp 0.6s ease-out 0.6s both; }

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

/* Efecto de validación visual con colores corporativos */
.form-control:valid {
    border-color: #007bff;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8"><path fill="%23007bff" d="m2.3 6.73.69-.66.67.66L6.44 4.1 7.09 4.81.85 9.06l-.72.58L1.67 7.2z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px 16px;
}

/* Indicador de carga para el botón */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Media queries para dispositivos móviles optimizados */
@media (max-width: 992px) {
    .container {
        margin: 25px auto;
        padding: 35px 25px;
        max-width: calc(100% - 50px);
    }
    
    /* Cambiar a layout vertical en tablets y móviles */
    .main-content {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }
    
    .image-column,
    .form-column {
        width: 100%;
        max-width: 500px;
    }
    
    .img-container {
        margin-bottom: 0;
    }
    
    .img-container img {
        max-width: 80%;
        width: auto;
    }
    
    .main-header {
        margin-bottom: 35px;
    }
    
    .main-header h2 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 30px 20px;
        max-width: calc(100% - 40px);
    }
    
    .main-content {
        gap: 30px;
    }
    
    .image-column,
    .form-column {
        max-width: none;
    }
    
    .img-container img {
        max-width: 90%;
    }
    
    .main-header {
        margin-bottom: 30px;
    }
    
    .main-header h2 {
        font-size: 24px;
    }
    
    .form-control, .form-select {
        padding: 14px 18px;
        font-size: 16px;
    }
    
    .phone-input-group {
        gap: 6px;
    }
    
    .country-code {
        flex: 0 0 120px;
        min-width: 120px;
    }
    
    .checkbox-header {
        gap: 10px;
        margin-bottom: 6px;
    }
    
    .checkbox-title {
        font-size: 15px;
    }
    
    .form-check {
        padding: 14px 16px;
    }
    
    .checkbox-description {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .form-check-input {
        width: 18px;
        height: 18px;
    }
    
    .btn-primary {
        padding: 14px 30px;
        font-size: 16px;
    }
    
    footer {
        margin-top: 40px;
        padding: 20px 15px;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
        border-top: 3px solid #dc3545;
    }
    
    footer p {
        font-size: 13px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 15px auto;
        padding: 25px 15px;
        max-width: calc(100% - 30px);
    }
    
    .main-content {
        gap: 25px;
    }
    
    .img-container img {
        max-width: 95%;
    }
    
    .main-header {
        margin-bottom: 25px;
    }
    
    .main-header h2 {
        font-size: 20px;
    }
    
    .form-control, .form-select {
        padding: 12px 15px;
        font-size: 16px; /* Mantenido en 16px para evitar zoom en iOS */
    }
    
    .phone-input-group {
        gap: 4px;
    }
    
    .country-code {
        flex: 0 0 100px;
        min-width: 100px;
    }
    
    .checkbox-header {
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .checkbox-title {
        font-size: 14px;
    }
    
    .form-check {
        padding: 12px 14px;
    }
    
    .checkbox-description {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .form-check-input {
        width: 16px;
        height: 16px;
    }
    
    .btn-primary {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    footer {
        margin-top: 35px;
        padding: 18px 10px;
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
    }
    
    footer p {
        font-size: 12px;
        line-height: 1.2;
    }
}

/* Optimización adicional para pantallas muy pequeñas */
@media (max-width: 360px) {
    .container {
        margin: 10px auto;
        padding: 20px 12px;
        max-width: calc(100% - 20px);
    }
    
    .form-control, .form-select {
        padding: 10px 12px;
    }
    
    .phone-input-group {
        gap: 3px;
    }
    
    .country-code {
        flex: 0 0 85px;
        min-width: 85px;
        font-size: 14px;
    }
    
    .main-header h2 {
        font-size: 24px;
    }
    
    .form-column {
        max-width: calc(100% - 10px);
    }
    
    .phone-number {
        font-size: 15px;
    }
    
    .checkbox-header {
        gap: 6px;
        margin-bottom: 4px;
    }
    
    .checkbox-title {
        font-size: 13px;
    }
    
    .form-check {
        padding: 10px 12px;
    }
    
    .checkbox-description {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .form-check-input {
        width: 14px;
        height: 14px;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    footer {
        padding: 15px 8px;
        margin-left: -5px;
        margin-right: -5px;
    }
}

/* Mejoras adicionales para accesibilidad */
.form-control:focus,
.form-select:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Animación sutil en hover para toda la página */
body {
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { 
        background: linear-gradient(135deg, #f8f9fa 0%, #f8f9fa 100%);
    }
    50% { 
        background: linear-gradient(135deg, #f8f9fa 0%, #f8f9fa 100%);
    }
}