﻿/* Login Container - Centrado vertical y horizontal */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    position: relative;
}

/* Card del login */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

/* Formulario */
.login-form {
    width: 100%;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Input groups */
.input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-right: none;
    padding: 12px 16px;
}

    .input-group-text i {
        color: #727cf5;
        font-size: 20px;
    }

.input-group .form-control {
    border-left: none;
    padding: 12px 16px;
    font-size: 16px;
    height: auto;
}

    .input-group .form-control:focus {
        border-color: #727cf5;
        box-shadow: none;
    }

.input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(114, 124, 245, 0.1);
}

/* Botón toggle password */
.toggle-password {
    border-left: none;
    padding: 12px 16px;
}

    .toggle-password:hover {
        background-color: #f8f9fa;
    }

/* Botón de login */
.btn-login {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    background-color: #727cf5;
    border: none;
    box-shadow: 0 4px 12px rgba(114, 124, 245, 0.3);
    transition: all 0.3s ease;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-login:hover {
        background-color: #5a67d8;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(114, 124, 245, 0.4);
    }

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

    .btn-login:disabled {
        background-color: #a5aef5;
        cursor: not-allowed;
        transform: none;
    }

/* Mensaje de error */
.alert-danger {
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    background-color: #fee;
    color: #e74c3c;
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

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

/* Indicador de conexión */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 600;
}

    .connection-status i {
        font-size: 18px;
    }

    .connection-status.online {
        color: #27ae60;
    }

    .connection-status.offline {
        color: #e74c3c;
    }

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .login-title {
        font-size: 28px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .connection-status {
        top: 10px;
        right: 10px;
        font-size: 12px;
    }
}

/* Animación del spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border {
    animation: spin 0.75s linear infinite;
}

/* Mejoras para inputs en móviles */
@supports (-webkit-touch-callout: none) {
    .form-control {
        font-size: 16px !important;
    }
}

/* Prevenir zoom en iOS al enfocar inputs */
input, textarea {
    font-size: 16px !important;
}
