/* Layout principal */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

/* Contenedor del login */
.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    animation: loginSlideIn 0.5s ease-out;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.login-title {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 400;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 1.5rem;
}


.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Botón de login */
.login-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.login-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mensajes de error */
.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #fcc;
    font-size: 0.875rem;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-message.hide {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Información de seguridad */
.security-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.85rem;
    color: #666;
    border: 1px solid #e9ecef;
}

.security-info h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.security-info p {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.security-info ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.security-info li {
    margin: 0.25rem 0;
}

/* Indicador de máquina */
.machine-indicator {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

/* Loading states */
.login-loading {
    position: relative;
    overflow: hidden;
}

.login-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    to {
        left: 100%;
    }
}

/* Iconos animados */
.login-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}


/* Estados del formulario */
.form-group.success .form-input {
    border-color: #10b981;
}

.form-group.error .form-input {
    border-color: #ef4444;
}

.form-group.success .form-input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group.error .form-input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Helper text */
.form-helper {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #6b7280;
}

.form-helper.error {
    color: #ef4444;
}

.form-helper.success {
    color: #10b981;
}

/* Checkbox personalizado */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-input {
    width: auto;
    margin: 0;
}

.checkbox-label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

/* Enlaces */
.login-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.login-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Divider */
.login-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.login-divider span {
    background: white;
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    position: relative;
}

/* Footer del login */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #9ca3af;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 1.5rem;
        max-width: 100%;
        margin: 0;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.8rem;
    }
    
    .form-input {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
    
    .login-button {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
    
    .security-info {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .machine-indicator {
        font-size: 0.75rem;
        padding: 0.375rem;
    }
}

@media (max-width: 320px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-title {
        font-size: 1.25rem;
    }
    
    .form-input {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .login-button {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Estados de accesibilidad */
.form-input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.login-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modo oscuro (si se implementa en el futuro) */
@media (prefers-color-scheme: dark) {
    .login-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .login-title {
        color: #f9fafb;
    }
    
    .login-subtitle {
        color: #d1d5db;
    }
    
    .form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-input::placeholder {
        color: #9ca3af;
    }
    
    .security-info {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .security-info h4 {
        color: #f9fafb;
    }
    
    .machine-indicator {
        background: rgba(31, 41, 55, 0.5);
        color: #d1d5db;
    }
    
    .login-divider::before {
        background: #4b5563;
    }
    
    .login-divider span {
        background: #1f2937;
        color: #d1d5db;
    }
    
    .login-footer {
        border-color: #4b5563;
        color: #9ca3af;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* Responsive para tarjetas de roles */
@media (max-width: 480px) {
    .role-cards {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .role-card {
        padding: 0.75rem;
    }
    
    .role-header h4 {
        font-size: 0.9rem;
    }
    
    .role-details p {
        font-size: 0.8rem;
    }
}

/* Ajustar el contenedor principal para las tarjetas */
.login-container {
    max-width: 500px;
}

@media (max-width: 580px) {
    .login-container {
        max-width: 100%;
    }
}
