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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor principal */
.container {
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease-out;
}

/* Tarjeta de login */
.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Contenedor de la imagen */
.image-container {
    text-align: center;
    margin-bottom: 30px;
}

.login-image {
    max-width: 120px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.login-image:hover {
    transform: scale(1.05);
}

/* Placeholder para cuando no hay imagen */
.image-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-placeholder:hover {
    transform: scale(1.05);
}

.placeholder-content {
    text-align: center;
    color: white;
}

.placeholder-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.placeholder-content p {
    font-size: 12px;
    margin: 0;
}

/* Título */
.login-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    position: relative;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-label .icon {
    margin-right: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #e74c3c;
    animation: shake 0.5s;
}

/* Wrapper para contraseña con botón de toggle */
.password-wrapper {
    position: relative;
}

.password-input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.toggle-password:focus {
    outline: none;
}

/* Mensajes de error */
.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    min-height: 20px;
}

/* Botón de login */
.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

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

.button-text, .button-loader {
    display: inline-block;
}

/* Footer con enlaces */
.login-footer {
    margin-top: 25px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

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

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

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 25px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .login-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Estado de carga */
.loading {
    position: relative;
    pointer-events: none;
}

.loading .button-text {
    visibility: hidden;
}

.loading .button-loader {
    display: inline-block !important;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}