/* --- 1. BASE Y FONDO --- */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Fondo oscuro profundo con degradado sutil */
    background: linear-gradient(140deg, #2b59c0 10%, #0f172a 50%, #06339a 100%);
    overflow-y: auto;
    padding: 20px 0;
    color: #f1f5f9;
}

.login-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- 2. CAJA DE CRISTAL (GLASS BOX) --- */
.glass-box {
    width: 90%;
    max-width: 380px;
    padding: 40px 30px;
    border-radius: 24px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.6) !important;
    box-sizing: border-box;
}

/* --- 3. LOGO / AVATAR --- */
.avatar-container {
    width: 100%;
    max-width: 180px;
    margin: 0 auto 30px;
     background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-container img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.3));
}

/* --- 4. INPUTS Y CONTENEDORES (CORREGIDOS) --- */
.input-group-custom, .password-container {
    display: flex !important;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.7) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    height: 55px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-group-custom:focus-within, .password-container:focus-within {
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    background: rgba(30, 41, 59, 0.9) !important;
}

.input-group-custom input, .password-container input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #f1f5f9 !important;
    font-size: 16px;
    text-align: center;
    padding: 0 !important; /* Quitamos el padding lateral que tenías */
}

/* Añadimos un espacio vacío a la izquierda solo en el contenedor de password 
   que mida lo mismo que el botón del ojo (60px) */
.password-container::before {
    content: "";
    width: 60px;
    display: block;
}

/* Ojo de contraseña */
#togglePassword {
    background: transparent !important;
    border: none !important;
    color: rgba(148, 163, 184, 0.8) !important;
    width: 60px !important;      /* Ancho fijo cómodo para el dedo */
    min-width: 60px !important;  /* Evita que el flex lo comprima */
    height: 100%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: color 0.3s;
}

#togglePassword:hover {
    color: #60a5fa !important;
}

/* --- 5. BOTÓN ESTILO "CRM AGENT" --- */
.btn-login {
    width: 100% !important;
    height: 55px !important;
    border-radius: 12px !important;
    border: 1.5px solid #60a5fa !important;
    font-weight: 700 !important;
    font-size: 17px !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: white !important;
    background: radial-gradient(circle, #1e3a8a 0%, #0f172a 100%) !important;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4) !important;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-top: 10px;
}

.btn-login:hover {
    transform: scale(1.02);
    border-color: #93c5fd !important;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6) !important;
    background: radial-gradient(circle, #2563eb 0%, #0f172a 100%) !important;
    /* Efecto de pulso suave al pasar el mouse */
    animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 25px rgba(37, 99, 235, 0.7); }
    100% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.4); }
}

/* --- 6. ALERTAS EN PARTE SUPERIOR --- */
.alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    padding: 15px 25px;
    border-radius: 14px;
    z-index: 10000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    animation: slideInTop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideInTop {
    from { top: -100px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}


.alert.danger {
    background: rgba(220, 38, 38, 0.6);
    border: 1px solid #ef4444;
    color: white !important;
}

.alert.success {
    background: rgba(22, 163, 74, 0.6);
    border: 1px solid #4ade80;
    color: white !important;
}

/* --- 7. FIX AUTORELLENO Y MÓVIL --- */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9 !important;
    /*-webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
    background: rgba(15, 23, 42, 0.7) !important;*/
    transition: background-color 5000s ease-in-out 0s;
}

/* Footer centrado */
.login-footer {
    margin-top: 25px;
    font-size: 14px;
    color: #94a3b8;
}

.login-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
}
