/* ======= Contenedor principal del formulario ======= */
.medical-contact-form-wrapper {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color, #2b2c53), #0da7bb);
    padding: 40px 20px;
    margin: 20px 0;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.medical-contact-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.1" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

/* ======= Imagen del doctor ======= */
.medical-doctor-img {
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: filter 0.5s ease, transform 0.3s ease;
    border: 3px solid rgba(255,255,255,0.2);
}

.medical-doctor-img:hover {
    filter: grayscale(100%);
    transform: scale(1.05) rotate(2deg);
}

/* ======= Card del formulario ======= */
.medical-form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    color: #2b2c53;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.1),
        0 10px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.medical-form-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.15),
        0 15px 30px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.medical-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    pointer-events: none;
}

/* ======= Botón principal ======= */
.medical-btn-primary {
    background: linear-gradient(135deg, #f95759, #d43f3f);
    border: none;
    font-weight: bold;
    border-radius: 12px;
    padding: 14px 24px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(249, 87, 89, 0.3);
}

.medical-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.6s ease;
}

.medical-btn-primary:hover::before {
    left: 100%;
}

.medical-btn-primary:hover {
    background: linear-gradient(135deg, #d43f3f, #b83333);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(249, 87, 89, 0.4);
}

.medical-btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(249, 87, 89, 0.4);
}

.medical-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ======= Inputs mejorados ======= */
.medical-form .form-control {
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    padding: 12px 16px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
    font-size: 16px;
}

.medical-form .form-control:focus {
    border-color: #0da7bb;
    box-shadow: 0 0 0 0.2rem rgba(13, 167, 187, 0.25);
    background: rgba(255,255,255,0.95);
    transform: translateY(-2px);
}

.medical-form .form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* ======= Labels estilizados ======= */
.medical-form .form-label {
    font-weight: 600;
    color: #2b2c53;
    margin-bottom: 8px;
    position: relative;
}

.medical-form .form-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0da7bb, #f95759);
    transition: width 0.3s ease;
}

.medical-form .form-control:focus + .form-label::after,
.medical-form .form-control:focus ~ .form-label::after {
    width: 100%;
}

/* ======= Título del formulario ======= */
.medical-form-card h3 {
    color: #2b2c53;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.medical-form-card h3 i {
    color: #0da7bb;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ======= Alertas mejoradas ======= */
.medical-alert-box {
    margin-bottom: 20px;
}

.medical-alert-box .alert {
    border-radius: 12px;
    border: none;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: slideInDown 0.3s ease;
}

.medical-alert-box .alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c2c7);
    color: #721c24;
}

.medical-alert-box .alert-success {
    background: linear-gradient(135deg, #d1f2eb, #a7f3d0);
    color: #0f5132;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======= Efectos de loading ======= */
.medical-form.loading .form-control {
    pointer-events: none;
    opacity: 0.7;
}

.medical-form.loading .medical-btn-primary {
    pointer-events: none;
}

/* ======= Responsive ======= */
@media (max-width: 768px) {
    .medical-contact-form-wrapper {
        padding: 20px 15px;
        margin: 10px 0;
    }
    
    .medical-form-card {
        padding: 20px !important;
    }
    
    .medical-doctor-img {
        margin-bottom: 30px;
        max-width: 250px;
    }
    
    .medical-form-card h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .medical-contact-form-wrapper {
        padding: 15px 10px;
        border-radius: 8px;
    }
    
    .medical-form-card {
        border-radius: 16px;
        padding: 15px !important;
    }
    
    .medical-form .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ======= Animaciones adicionales ======= */
.medical-form .mb-3 {
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: both;
}

.medical-form .mb-3:nth-child(1) { animation-delay: 0.1s; }
.medical-form .mb-3:nth-child(2) { animation-delay: 0.2s; }
.medical-form .mb-3:nth-child(3) { animation-delay: 0.3s; }
.medical-form .mb-3:nth-child(4) { animation-delay: 0.4s; }
.medical-form .mb-3:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======= Estados de validación ======= */
.medical-form .form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.medical-form .form-control.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* ======= Mejoras de accesibilidad ======= */
.medical-form .form-control:focus {
    outline: none;
}

.medical-btn-primary:focus {
    outline: 2px solid #0da7bb;
    outline-offset: 2px;
}

/* ======= Indicador de campo requerido ======= */
.medical-form .form-label::before {
    content: '* ';
    color: #f95759;
    font-weight: bold;
}

.column-imagen-form{
    margin-top: -110px !important;
}