/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #3c3d3c 0%, #5a5b5a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* permitir scroll si el contenido no cabe */
    position: relative;
}

/* Contenedor principal */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

/* Tarjeta de login */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.6s ease;
    cursor: default;
    position: relative;
    z-index: 11;
}

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

/* Header del login */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 80px;
    height: 80px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(60, 61, 60, 0.3);
    overflow: hidden;
    padding: 5px;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.login-header h1 {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: #718096;
    font-size: 1rem;
}

/* Formulario */
.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.form-group label i {
    color: #3c3d3c;
    width: 16px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #3c3d3c;
    box-shadow: 0 0 0 3px rgba(60, 61, 60, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #a0aec0;
}

/* Botón de login */
.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3c3d3c 0%, #5a5b5a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn::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;
}

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

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(60, 61, 60, 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner i {
    font-size: 18px;
}

/* Footer */
.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.demo-credentials {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.demo-credentials h3 {
    color: #4a5568;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.demo-credentials p {
    color: #718096;
    font-size: 13px;
    margin-bottom: 5px;
}

.demo-credentials p:last-child {
    margin-bottom: 0;
}

/* Animaciones de fondo */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 10%;
    right: 30%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.notification.error {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsive */
@media (max-width: 480px) {
    body {
        align-items: flex-start; /* evitar bloqueo de scroll al centrar en pantallas pequeñas */
        padding: 20px 0;
    }
    .login-container {
        padding: 12px;
        max-width: 340px; /* formularios más compactos en móvil */
    }
    
    .login-card {
        padding: 20px 16px; /* reducir padding para que quepa */
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        width: 56px;
        height: 56px;
    }

    .form-group {
        margin-bottom: 18px;
    }
    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 10px;
    }
    .login-btn {
        padding: 12px;
        font-size: 15px;
        border-radius: 10px;
    }
}

/* Estados de carga */
.loading {
    opacity: 0.7;
}

.loading .login-btn {
    background: #a0aec0;
    pointer-events: none;
}

/* Asegurar que los inputs siempre sean clickeables */
.form-group input {
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

/* Asegurar que el formulario completo sea clickeable */
.login-form {
    position: relative;
    z-index: 100;
}

/* Efectos de error */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
